Browse Source

Protect variable names, to be consistent with rc(8).

ok robert@
OPENBSD_4_9
ajacoutot 14 years ago
parent
commit
cfcca0b7b6
1 changed files with 7 additions and 7 deletions
  1. +7
    -7
      src/etc/rc.d/rc.subr

+ 7
- 7
src/etc/rc.d/rc.subr View File

@ -1,4 +1,4 @@
[ -z "$local_rcconf" ] && . /etc/rc.conf
[ -z "${local_rcconf}" ] && . /etc/rc.conf
rc_err() {
echo $1
@ -7,26 +7,26 @@ rc_err() {
rc_start() {
type rc_pre >/dev/null && rc_pre
$daemon $daemon_flags >/dev/null
${daemon} ${daemon_flags} >/dev/null
}
rc_check() {
pgrep -f "^$pexp" >/dev/null
pgrep -f "^${pexp}" >/dev/null
}
rc_reload() {
pkill -HUP -f "^$pexp"
pkill -HUP -f "^${pexp}"
}
rc_stop() {
pkill -f "^$pexp"
pkill -f "^${pexp}"
type rc_post >/dev/null && rc_post || return 0
}
rc_cmd() {
[ `id -u` -eq 0 -o X"$1" = "Xcheck" ] || rc_err "$0: need root privileges"
[ -n "$daemon" ] || rc_err "$0: daemon is not set"
[ -n "$pexp" ] || pexp="$daemon${daemon_flags:+ $daemon_flags}"
[ -n "${daemon}" ] || rc_err "$0: daemon is not set"
[ -n "${pexp}" ] || pexp="${daemon}${daemon_flags:+ ${daemon_flags}}"
case "$1" in
check)


Loading…
Cancel
Save