diff options
author | 2010-12-11 12:57:21 +0000 | |
---|---|---|
committer | 2010-12-11 12:57:21 +0000 | |
commit | 06fa6deafde068a3e14d8dfa8dbb2274f2b9d967 (patch) | |
tree | 3b0a5306960838d2cb437e212758d256b436fc8f | |
parent | update subst_vars list; ok ajacoutot@ (diff) | |
download | wireguard-openbsd-06fa6deafde068a3e14d8dfa8dbb2274f2b9d967.tar.xz wireguard-openbsd-06fa6deafde068a3e14d8dfa8dbb2274f2b9d967.zip |
Make it possible to mark an rc action as unsupported by setting the
corresponding variable to NO.
e.g.
rc_reload=NO
This will save us the trouble of copying the same rc_reload() function
(or others) all over the tree.
ok robert@
-rw-r--r-- | etc/rc.d/rc.subr | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/etc/rc.d/rc.subr b/etc/rc.d/rc.subr index 128559c6fda..705608390cc 100644 --- a/etc/rc.d/rc.subr +++ b/etc/rc.d/rc.subr @@ -1,4 +1,4 @@ -# $OpenBSD: rc.subr,v 1.11 2010/12/11 10:15:23 ajacoutot Exp $ +# $OpenBSD: rc.subr,v 1.12 2010/12/11 12:57:21 ajacoutot Exp $ [ -z "${local_rcconf}" ] && . /etc/rc.conf @@ -29,11 +29,13 @@ rc_stop() { rc_cmd() { _name=`basename $0` + eval _enotsup=\${rc_${1}} eval _rcflags=\${${_name}_flags} eval _rcuser=\${${_name}_user} eval _rcclass=\${${_name}_class} eval _rcshell=\${${_name}_shell} + [ X"${_enotsup}" != X"NO" ] || rc_err "$0: $1 is not supported" [ `id -u` -eq 0 -o X"$1" = "Xcheck" ] || \ rc_err "$0: need root privileges" [ -n "${daemon}" ] || rc_err "$0: daemon is not set" |