help:
@echo "read the Makefile to see available targets"
-checkdepends: /usr/bin/lxc-start /lib/bridge-utils /usr/bin/netmask /usr/sbin/debootstrap /usr/sbin/rinse /usr/bin/yum /usr/sbin/tunctl
+checkdepends: /usr/bin/lxc-start /lib/bridge-utils /usr/bin/netmask /usr/sbin/debootstrap /usr/sbin/rinse /usr/bin/yum
/usr/bin/lxc-start:
@[ -f $@ ] || apt-get install lxc
/usr/bin/yum:
@[ -f $@ ] || apt-get install yum
-/usr/sbin/tunctl:
- @[ -f $@ ] || apt-get install uml-utilities
-
installtemplate: /usr/local/sbin/lxc-wrapper
/usr/local/sbin/lxc-wrapper: lxc-wrapper
# Destroy the VM if found
destroy_vm $1 || true
fi
-
sudo /usr/local/sbin/lxc-wrapper start $(basename $HOST .local)
-
+
echo "Waiting for $HOST to come up..."
i=0
- while [ $i -lt 10 ] && ! test_host ; do
+ # Done in this script rather than lxc-wrapper, because we have the SSH key
+ while [ $i -lt 10 ] && ! ssh -o 'StrictHostKeyChecking=no' root@$HOST uname -a >/dev/null; do
sleep 10
i=$(($i+1))
echo -n .
done
-
- if test_host ; then
+ if [ $i -lt 10 ] ; then
echo " OK"
else
echo " FAIL"
fi
}
-test_host () {
- ssh -o 'StrictHostKeyChecking=no' "root@$HOST" uname -a >/dev/null 2>&1
-}
-
stop_vm() {
HOST=$1
if ! $KEEPVM; then