grml-vnet: add help message on missing device name
authorMichael Gebetsroither <michael@mgeb.org>
Wed, 10 Feb 2010 17:47:35 +0000 (18:47 +0100)
committerMichael Gebetsroither <michael@mgeb.org>
Wed, 10 Feb 2010 17:47:35 +0000 (18:47 +0100)
sbin/grml-vnet

index 97e4901..82aca72 100755 (executable)
@@ -93,6 +93,12 @@ while getopts "du:g:b:ah" opt; do
 done
 shift $(($OPTIND - 1))
 
+if [[ $# < 1 ]]; then
+    echo "Error: Please give at least one device" >&2
+    printUsage
+    exit 1
+fi
+
 if [[ $OPT_DEL_ == 'false' ]]; then
     if [[ $OPT_BRIDGE_ != '' && $OPT_AUTO_ == 'true' ]]; then
         brctl showmacs "$OPT_BRIDGE_" &>/dev/null || brctl addbr "$OPT_BRIDGE_"