-
-
Save eberfreitas/32aab76b9cd762efccab to your computer and use it in GitHub Desktop.
Revisions
-
eberfreitas created this gist
Nov 13, 2015 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,24 @@ #!/bin/bash VBOXPATH="/cygdrive/c/Program Files/Oracle/VirtualBox/VBoxManage.exe" case "$1" in "start" | "startvm") echo "Starting VM \"$2\"..." cmd="\"$VBOXPATH\" startvm $2 --type headless" eval $cmd ;; "getip" | "get") echo "Getting IP address for VM \"$2\"..." cmd="\"$VBOXPATH\" guestproperty get $2 /VirtualBox/GuestInfo/Net/0/V4/IP" eval $cmd ;; "poweroff" | "shutdown") echo "Shutting down VM \"$2\"..." cmd="\"$VBOXPATH\" controlvm $2 poweroff" eval $cmd ;; *) echo "Unknown command!" ;; esac