diff options
Diffstat (limited to 'sh/runscript.sh')
-rwxr-xr-x | sh/runscript.sh | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/sh/runscript.sh b/sh/runscript.sh index 5ba1004d..78433e87 100755 --- a/sh/runscript.sh +++ b/sh/runscript.sh @@ -59,18 +59,18 @@ describe() { done } -yesno ${RC_DEBUG} && set -x +yesno ${rc_debug} && set -x # If we're net.eth0 or openvpn.work then load net or openvpn config -rc_c=${SVCNAME%%.*} -if [ -n "${rc_c}" -a "${rc_c}" != "${SVCNAME}" ]; then - if [ -e "/etc/conf.d/${rc_c}.${RC_SOFTLEVEL}" ]; then - . "/etc/conf.d/${rc_c}.${RC_SOFTLEVEL}" - elif [ -e "/etc/conf.d/${rc_c}" ]; then - . "/etc/conf.d/${rc_c}" +_c=${SVCNAME%%.*} +if [ -n "${_c}" -a "${_c}" != "${SVCNAME}" ]; then + if [ -e "/etc/conf.d/${_c}.${RC_SOFTLEVEL}" ]; then + . "/etc/conf.d/${_c}.${RC_SOFTLEVEL}" + elif [ -e "/etc/conf.d/${_c}" ]; then + . "/etc/conf.d/${_c}" fi fi -unset rc_c +unset _c # Overlay with our specific config if [ -e "/etc/conf.d/${SVCNAME}.${RC_SOFTLEVEL}" ]; then @@ -83,7 +83,7 @@ fi [ -e /etc/rc.conf ] && . /etc/rc.conf # Apply any ulimit defined -[ -n "${RC_ULIMIT}" ] && ulimit ${RC_ULIMIT} +[ -n "${rc_ulimit:-${RC_ULIMIT}}" ] && ulimit ${rc_ulimit:-${RC_ULIMIT}} # Load our script . $1 @@ -128,10 +128,10 @@ fi while [ -n "$1" ]; do # See if we have the required function and run it - for rc_x in describe start stop ${extra_commands:-${opts}}; do - if [ "${rc_x}" = "$1" ]; then + for _cmd in describe start stop ${extra_commands:-${opts}}; do + if [ "${_cmd}" = "$1" ]; then if type "$1" >/dev/null 2>&1; then - unset rc_x + unset _cmd if type "$1"_pre >/dev/null 2>&1; then "$1"_pre || exit $? fi @@ -142,7 +142,7 @@ while [ -n "$1" ]; do shift continue 2 else - if [ "${rc_x}" = "start" -o "${rc_x}" = "stop" ]; then + if [ "${_cmd}" = "start" -o "${_cmd}" = "stop" ]; then exit 0 else eerror "${SVCNAME}: function \`$1' defined but does not exist" |