scripts/devnet: print usage if no arguments are provided

Before:

    $ sudo ./scripts/devnet
    ./scripts/devnet: line 20: $1: unbound variable

After:

    $ sudo ./scripts/devnet
    USAGE: devnet <command>
    Commands:
    	create	create bootcfg and PXE services on the bridge
    	destroy	destroy the services on the bridge
This commit is contained in:
Eric Chiang
2016-09-22 11:00:37 -07:00
parent 7b1640b1c6
commit f0465c0d0b

View File

@@ -17,6 +17,10 @@ if [ "$EUID" -ne 0 ]
fi
function main {
if [ "$#" -ne 1 ]; then
usage
exit 2
fi
case "$1" in
"create") create;;
"destroy") destroy;;