From 0a044bae97fbbd9c0a18d8016cdc863297fbf07e Mon Sep 17 00:00:00 2001 From: P. J. McDermott Date: Tue, 03 Jun 2014 12:39:43 -0400 Subject: /etc/rc.common: Better handle missing action arg. --- diff --git a/src.etc/rc.common b/src.etc/rc.common index c6ccf85..8bd589c 100644 --- a/src.etc/rc.common +++ b/src.etc/rc.common @@ -19,7 +19,7 @@ STOP='' main() { - local action="${2}" + local action= local es= SCRIPT="${1}" @@ -31,6 +31,11 @@ main() ALL_CMDS="${ALL_CMDS} enable disable " fi + if [ ${#} -ne 2 ]; then + usage + return 1 + fi + action="${2:-}" if [ "x${ALL_CMDS#* ${action} }" != "x${ALL_CMDS}" ]; then if [ "x${action}" = 'xstart' ] && [ -e /etc/rc.policy ]; then [ "x$(cat /etc/rc.policy)" = 'disabled' ] && return 0 -- cgit v0.9.1