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 error_message() # $* = Error Message
{ {
echo " $@" >&2 echo " $@" >&2
return 1
} }
# #

View File

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