6 BUILD="${HOME}/git-build"
15 [ -d $LOGS ] || { echo "Creating logs dir $LOGS" ; mkdir -p $LOGS; }
17 DOMAIN=pl.sophia.inria.fr
20 # do not care about 32 bits anymore
21 #DEFAULT_PERSO=linux64
24 DISTRO=$DEFAULT_DISTRO
27 echo "usage : $COMMAND [-i] [-f distro] hostname"
28 echo " default distro is $DEFAULT_DISTRO"
29 [ -n "$message" ] && echo $message
33 while getopts "f:ih" flag; do
36 i) INTERACTIVE=true ;;
41 [[ -z "$@" ]] && usage "no hostname provided"
42 container="$1" ; shift
43 [[ -n "$@" ]] && usage "extra arguments" "$@" "(hostname=$container)"
46 [ -d "$BUILD" ] || usage "Could not find directory $BUILD"
48 [ -d /vservers/$container ] && usage "container $container already exists in /vservers"
50 fqdn=$container.$DOMAIN
52 command="$BUILD/lbuild-initvm.sh -f $DISTRO -n $fqdn $container"
54 if [ -n "$INTERACTIVE" ] ; then
55 echo -n "Run $command OK ? "
56 read answer ; case $answer in [nN]*) exit 1 ;; esac
59 echo "Storing output in $LOGS/$container.log"
60 $command >& $LOGS/$container.log