diff options
author | Silvio Rhatto <rhatto@riseup.net> | 2014-09-18 16:38:37 -0300 |
---|---|---|
committer | Silvio Rhatto <rhatto@riseup.net> | 2014-09-18 16:46:56 -0300 |
commit | 9a3bd68531120d51c5203cd9fc9e030c5e684324 (patch) | |
tree | 15e62a764fa8f987c2237c89a8a3118b74d652dd | |
download | vbox-9a3bd68531120d51c5203cd9fc9e030c5e684324.tar.gz vbox-9a3bd68531120d51c5203cd9fc9e030c5e684324.tar.bz2 |
Initial import
-rw-r--r-- | README.md | 0 | ||||
-rw-r--r-- | TODO.md | 7 | ||||
-rwxr-xr-x | vbox | 39 |
3 files changed, 46 insertions, 0 deletions
diff --git a/README.md b/README.md new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/README.md @@ -0,0 +1,7 @@ +TODO +==== + +* Support more VBoxManage commands. +* Iteration over a set of VMs. +* Support for upgrading VMs. +* Vagrant integration. @@ -0,0 +1,39 @@ +#!/bin/bash +# +# Simple wrapper around VBoxManage. +# + +# Parameters +BASENAME="`basename $0`" +COMMAND="$1" +VM="$2" + +# Usage +function usage { + echo "usage: $BASENAME <command> [vm]" + exit 1 +} + +# Build options +if [ ! -z "$VM" ]; then + if [ "$COMMAND" == "up" ]; then + OPTIONS="" + COMMAND="startvm" + elif [ "$COMMAND" == "down" ]; then + OPTIONS="savestate" + COMMAND="controlvm" + elif [ "$COMMAND" == "halt" ]; then + OPTIONS="poweroff" + COMMAND="controlvm" + else + usage + fi +elif [ "$COMMAND" == "status" ]; then + OPTIONS="runningvms" + COMMAND="list" +else + usage +fi + +# Dispatch +VBoxManage $COMMAND $VM $OPTIONS |