Skip to content

Instantly share code, notes, and snippets.

@siwells
Created August 1, 2011 11:09
Show Gist options
  • Save siwells/1117944 to your computer and use it in GitHub Desktop.
Save siwells/1117944 to your computer and use it in GitHub Desktop.
A Bash script to check whether the network for a given VM is up and running. It will look for the VirtualBox reserved NAT IP (10.0.2.15). If found the VM is up & running, otherwise inform the user then sleep for 10 seconds before trying again.
#!/bin/bash
function checknet {
UP=$(VBoxManage guestproperty enumerate omero-vm | grep "10.0.2.15")
}
checknet
echo "UP :: " $UP
while [ -z "$UP" ]
do
checknet
echo "VM not fully up yet..."
echo "Sleeping for 10 seconds then trying again."
sleep 10
done
echo "VM Running"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment