6 BUILD="${HOME}/git-build"
7 DOMAIN=pl.sophia.inria.fr
11 echo "usage : $COMMAND hostname distro"
12 [ -n "$message" ] && echo $message
16 [ -d "$BUILD" ] || usage "Could not find directory $BUILD"
18 [[ -z "$@" ]] && usage "no hostname provided"
20 [[ -z "$@" ]] && usage "no distro provided"
22 [[ -n "$@" ]] && usage "extra arguments"
24 [ -d /vservers/$hostname ] && usage "vserver $hostname already exists in /vservers"
25 [ -d /etc/vservers/.distributions/$distro ] || usage "distro $distro not known in /etc/vservers/.distributions/"
27 fqdn=$hostname.$DOMAIN
29 host $fqdn | grep -q 'has address' || usage "hostname $fqdn not known to DNS"
30 ip=$(host $fqdn | grep 'has address' | awk '{print $4}')
36 command="$BUILD/vtest-init-vserver.sh -p linux64 -f $distro $hostname none -- --netdev eth0 --interface $ip --hostname $fqdn"
38 echo "Run $command OK ? "
39 read _ ; case $_ in [nN]*) exit 1 ;; esac