Active status check
Brought to you by:
markbaa
VBoxTool should actively check for status after each command. If the desired state is not reached, this should be logged in the vboxtool log file.
Code examples:
timeout() { perl -e 'alarm shift; exec @ARGV' "$@"; } #Create a timeout command with perl. More portable this way.
timeout 300 bash -c "echo "Waiting..." ; while $su_command vboxtool\ show | grep running ; do sleep 1 ; done"
wait_for_closing_machines() {
RUNNING_MACHINES=`$SU "$VBOXMANAGE list runningvms" | wc -l`
if [ $RUNNING_MACHINES != 0 ]; then
sleep 5
wait_for_closing_machines
fi
}