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"
exit 1
}
-while getopts "fp:ih" flag; do
+while getopts "f:p:ih" flag; do
case $flag in
f) DISTRO=$OPTARG;;
p) PERSO=$OPTARG;;
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"
git pull
cd -
-command="$BUILD/vtest-init-vserver.sh -p $PERSO -f $DISTRO $HOSTNAME none -- --netdev eth0 --interface $ip --hostname $fqdn"
+# single_ip needs to be turned off, vtest-initvm now takes care of that
+command="$BUILD/vtest-initvm.sh -p $PERSO -f $DISTRO $HOSTNAME none -- --interface eth0:$ip --hostname $fqdn"
if [ -n "$INTERACTIVE" ] ; then
echo -n "Run $command OK ? "