From: Thierry Parmentelat Date: Wed, 1 Jun 2011 09:17:13 +0000 (+0200) Subject: oops X-Git-Url: http://git.onelab.eu/?a=commitdiff_plain;h=0b862f2e435cfa1fad281bb2d6479c9f60a96c11;p=infrastructure.git oops --- diff --git a/scripts/create-vm.sh b/scripts/create-vm.sh index b6d477d..8987106 100755 --- a/scripts/create-vm.sh +++ b/scripts/create-vm.sh @@ -13,7 +13,7 @@ INTERACTIVE= DISTRO=$DEFAULT_DISTRO PERSO=$DEFAULT_PERSO function usage () { - message="$1" ; shift + message="$@" echo "usage : $COMMAND [-i] [-f distro] [-p perso] hostname" echo " default distro is $DEFAULT_DISTRO" echo " default perso is $DEFAULT_PERSO" @@ -21,7 +21,7 @@ function usage () { exit 1 } -while getopts "fp:ih" flag; do +while getopts "f:p:ih" flag; do case $flag in f) DISTRO=$OPTARG;; p) PERSO=$OPTARG;; @@ -32,7 +32,7 @@ done shift $((OPTIND-1)) [[ -z "$@" ]] && usage "no hostname provided" HOSTNAME="$1" ; shift -[[ -n "$@" ]] && usage "extra arguments" +[[ -n "$@" ]] && usage "extra arguments" "$@" "(hostname=$HOSTNAME)" [ -d "$BUILD" ] || usage "Could not find directory $BUILD"