Commit b77a5b6d authored by Steffen Gebert's avatar Steffen Gebert
Browse files

wait for VM shutdown

parent 05a92d57
......@@ -51,6 +51,22 @@ then
fi
# helper function to wait until the VM has shut down
wait_for_shutdown()
{
echo "Waiting for shutdown of $1"
while true; do
virsh list | grep -c $1 > /dev/null
if [ $? -eq 1 ]; then
echo
echo "VM stopped: $1"
return 0
fi
sleep 1
echo -n "."
done
}
# note on preseeding
# file must be injected in the root/intrd filesysetm
# if file is not named preseed.cfg the file name must be passed to the kerne like preseed/file=/some/whatever.cfg
......@@ -82,6 +98,8 @@ echo "Doing some aftermath..."
# shutdown
virsh shutdown $SERVER_NAME
wait_for_shutdown $SERVER_NAME
# copy ssh-keys of admins into machine
# generate ssh-authorized keys so they can be uploaded into the root-account
SCRIPT_PATH=$(dirname $([ -L $0 ] && readlink -f $0 || echo $0))
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment