Commit 1dbbcc3d authored by Jonathan Michalon's avatar Jonathan Michalon

create-vm-arn: Debian Stretch is out, accept it and default to it

parent b35bd3f7
......@@ -31,7 +31,7 @@ disk='50'
ram='1024'
ipv4=
ipv6=
suite='jessie'
suite='stretch'
sshkey=
iso=
......@@ -47,7 +47,7 @@ Usage: $(basename $0) -n name [-d size] [-r size] [-4 IPv4prefixe(s)] [-6 IPv6p
-r <memory-size> Memory size in MB (default: $ram)
-4 <ipv4> IPv4 route(s) (optional)
-6 <ipv6> IPv6 route(s) (optional)
-s <suite> Debian suite to install (wheezy, jessie, ...) (default: $suite, valid: jessie)
-s <suite> Debian suite to install (wheezy, jessie, ...) (default: $suite, valid: jessie, stretch)
-k <file> SSH public key to allow for root login (optional)
-i <file> ISO to boot on (absolute path) (optional)
......@@ -72,10 +72,11 @@ while getopts "s:n:d:r:4:6:k:i:" opt; do
done
# check inputs
[ "$suite" = 'jessie' ] || show_usage 'Invalid Debian suite'
[ -n "$name" ] || show_usage 'Name empty'
[ "$disk" -ge 2 ] || show_usage 'Disk too small'
[ "$ram" -ge 128 ] || show_usage 'Too few RAM'
[ "$suite" = 'jessie' -o \
"$suite" = 'stretch' ] || show_usage 'Invalid Debian suite'
[ -n "$name" ] || show_usage 'Name empty'
[ "$disk" -ge 2 ] || show_usage 'Disk too small'
[ "$ram" -ge 128 ] || show_usage 'Too few RAM'
# should be sufficient…
[[ -z "$ipv4" || "$ipv4" =~ ^([0-9]{1,3}.){3}[0-9]{1,3}/[0-9]{1,2}( |$) ]] || show_usage 'Invalid IPv4'
[[ -z "$ipv6" || "$ipv6" =~ ^([0-9a-fA-F]{0,4}:){1,7}[0-9a-fA-F]{1,4}/[0-9]{1,3}( |$) ]] || show_usage 'Invalid IPv6'
......@@ -180,7 +181,7 @@ if [[ "$name" =~ ^vps- ]]; then
echo -en "\n\nSystème d'exploitation : "
[ -z "$iso" ] && echo -n "Debian GNU/Linux stable x86-64" || echo -n "personnalisé"
[ -z "$iso" ] && echo -n "Debian GNU/Linux $suite x86-64" || echo -n "personnalisé"
echo -e "\n\n"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment