From: Michael Gebetsroither Date: Wed, 10 Feb 2010 17:47:35 +0000 (+0100) Subject: grml-vnet: add help message on missing device name X-Git-Tag: v0.3.2~4 X-Git-Url: http://git.grml.org/?p=grml-network.git;a=commitdiff_plain;h=a83821ad0db031ccec60ea8d9c39e8da01031c8e grml-vnet: add help message on missing device name --- diff --git a/sbin/grml-vnet b/sbin/grml-vnet index 97e4901..82aca72 100755 --- a/sbin/grml-vnet +++ b/sbin/grml-vnet @@ -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_"