Detect missing <commmand> in the generated scrip

Signed-off-by: Tom Eastep <teastep@shorewall.net>
This commit is contained in:
Tom Eastep 2014-07-29 11:35:32 -07:00
parent 4e9a0b989d
commit 0bf80c15d8
2 changed files with 10 additions and 5 deletions

View File

@ -172,6 +172,7 @@ run_it() {
error_message() # $* = Error Message
{
echo " $@" >&2
return 1
}
#

View File

@ -17,7 +17,7 @@ usage() {
echo " reset"
echo " refresh"
echo " restart"
echo " run <function> [ <argument> ... ]"
echo " run <command> [ <parameter> ... ]"
echo " status"
echo " up <interface>"
echo " version"
@ -373,10 +373,14 @@ case "$COMMAND" in
status=0
;;
run)
if [ $# -gt 1 ]; then
shift
detect_configuration
eval $@
status=$?
else
error_message "ERROR: Missing command"
fi
;;
version)
[ $# -ne 1 ] && usage 2