aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSilvio Rhatto <rhatto@riseup.net>2014-06-13 17:08:18 -0300
committerSilvio Rhatto <rhatto@riseup.net>2014-06-13 17:08:18 -0300
commit22751e613fc2e3690b274af94a3f6c62ae39acab (patch)
tree0e7159bab15150f796368bf2dcc2ced4546325d7
parent11179540152eb6fe5d8b09be4a00cc3a4dcd1bdc (diff)
downloadscripts-22751e613fc2e3690b274af94a3f6c62ae39acab.tar.gz
scripts-22751e613fc2e3690b274af94a3f6c62ae39acab.tar.bz2
Fixing vbox usage
-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