summaryrefslogtreecommitdiff
path: root/etc
diff options
context:
space:
mode:
authorAntoine Jacoutot <ajacoutot@cvs.openbsd.org>2010-10-27 13:34:22 +0000
committerAntoine Jacoutot <ajacoutot@cvs.openbsd.org>2010-10-27 13:34:22 +0000
commit5b8c96555138d6ad7cf7e425bb7a05b3d2c27bad (patch)
treee0b007eb035a63b80cf88722afaff4f38e151467 /etc
parent60cce4caae3b1f15515e8265c2b69febac277b0c (diff)
Protect variable names, to be consistent with rc(8).
ok robert@
Diffstat (limited to 'etc')
-rw-r--r--etc/rc.d/rc.subr14
1 files changed, 7 insertions, 7 deletions
diff --git a/etc/rc.d/rc.subr b/etc/rc.d/rc.subr
index b09b652107f..ed6596e6dcd 100644
--- a/etc/rc.d/rc.subr
+++ b/etc/rc.d/rc.subr
@@ -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)