From: Thierry Parmentelat Date: Mon, 24 Mar 2014 13:32:22 +0000 (+0100) Subject: don't use HOSTNAME that is already set X-Git-Url: http://git.onelab.eu/?a=commitdiff_plain;h=7e2e404fb0dbd6ddff89fc23389216b3efc585b5;hp=1c786545fcb9bc967e0052d2023aa5709e45fb94;p=infrastructure.git don't use HOSTNAME that is already set --- diff --git a/scripts/create-vm.sh b/scripts/create-vm.sh index 5bf5cfa..c8c26c7 100755 --- a/scripts/create-vm.sh +++ b/scripts/create-vm.sh @@ -38,13 +38,14 @@ function usage () { exit 1 } +# using HOSTNAME won't work as this is already set in environment while getopts "cf:i:m:n:h" flag; do case $flag in c) CONFIRM=true ;; f) DISTRO=$OPTARG ;; i) IMAGE=$OPTARG ;; m) MEMORY=$OPTARG ;; - n) HOSTNAME=$OPTARG ;; + n) VM_HOSTNAME=$OPTARG ;; ?|h) usage "" ;; esac done @@ -60,8 +61,8 @@ container="$1" ; shift # comopute all vars from args [ -z "$DISTRO" ] && DISTRO="$DEFAULT_DISTRO" -[ -z "$HOSTNAME" ] && HOSTNAME="$container" -fqdn=$HOSTNAME.$DOMAIN +[ -z "$VM_HOSTNAME" ] && VM_HOSTNAME="$container" +fqdn=$VM_HOSTNAME.$DOMAIN # prepare initvm command initvm="$BUILD/lbuild-initvm.sh"