Skip to content

Commit

Permalink
Pass some environments. allow further args. Fix validity test
Browse files Browse the repository at this point in the history
  • Loading branch information
Martin Väth committed Sep 14, 2013
1 parent a5a3abc commit 715b831
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions bin/openrc-wrapper
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ SVCNAME=${1}
test -r "/etc/init.d/${SVCNAME}" || Usage 127
shift
if [ "${1}" = '-q' ]
then [ ${#} -eq 2 ] || Usage
then [ ${#} -ge 2 ] || Usage
shift
exec >/dev/null
else [ ${#} -eq 1 ] || Usage
else [ ${#} -ge 1 ] || Usage
fi
PATH='/lib/rc/bin:'${PATH:-/usr/local/bin:/usr/local/sbin:/usr/sbin:/usr/bin:/sbin:/bin:/opt/bin}
if ! command -v ebegin >/dev/null 2>&1
Expand Down Expand Up @@ -76,6 +76,10 @@ eoutdent() {
:
}
fi
RC_UNAME=`uname`
RC_VERSION=1
RC_TMPDIR='/run'
RC_WRAPPER=1
if test -r "/etc/conf.d/${SVCNAME}"
then . "/etc/conf.d/${SVCNAME}"
fi
Expand All @@ -89,9 +93,10 @@ for wrapper_i in start stop \
${extra_commands} \
${extra_started_commands} \
${extra_stopped_commands}
do [ "${1}" ] && {
"${1}"
do [ "${wrapper_i}" = "${1}" ] && {
"${@}"
exit
}
done
eerror "${SVCNAME} does not support '${1}'"
exit 1

0 comments on commit 715b831

Please sign in to comment.