aboutsummaryrefslogtreecommitdiff
path: root/vbox
diff options
context:
space:
mode:
Diffstat (limited to 'vbox')
-rwxr-xr-xvbox11
1 files changed, 9 insertions, 2 deletions
diff --git a/vbox b/vbox
index cb9dc85..42dd8af 100755
--- a/vbox
+++ b/vbox
@@ -8,6 +8,12 @@ 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
@@ -19,13 +25,14 @@ if [ ! -z "$VM" ]; then
elif [ "$COMMAND" == "halt" ]; then
OPTIONS="poweroff"
COMMAND="controlvm"
+ else
+ usage
fi
elif [ "$COMMAND" == "status" ]; then
OPTIONS="runningvms"
COMMAND="list"
else
- echo "usage: $BASENAME <command> [vm]"
- exit 1
+ usage
fi
# Dispatch