summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert Nagy <robert@cvs.openbsd.org>2011-03-24 07:28:32 +0000
committerRobert Nagy <robert@cvs.openbsd.org>2011-03-24 07:28:32 +0000
commit563791e39b7b5faf4456db0f90f172c20542eec4 (patch)
tree79dcc982cdbcefe229e53e514b873a56f7f1c946
parent13ff1a9a0d933b887cf0422844681758e3fdd3b1 (diff)
if daemon_flags=NO is set, just exit
ok ajacoutot@
-rw-r--r--etc/rc.d/rc.subr4
1 files changed, 3 insertions, 1 deletions
diff --git a/etc/rc.d/rc.subr b/etc/rc.d/rc.subr
index b62cf54f390..24d9eca9212 100644
--- a/etc/rc.d/rc.subr
+++ b/etc/rc.d/rc.subr
@@ -1,4 +1,4 @@
-# $OpenBSD: rc.subr,v 1.28 2011/03/19 19:03:57 ian Exp $
+# $OpenBSD: rc.subr,v 1.29 2011/03/24 07:28:31 robert Exp $
# Default functions and variables used by rc.d(8) scripts.
@@ -51,6 +51,8 @@ rc_cmd() {
[ $(id -u) -eq 0 ] || \
rc_err "$0: need root privileges"
+ [ X"${daemon_flags}" = X"NO" ] && exit 1
+
eval _enotsup=\${rc_${1}}
[ X"${_enotsup}" != X"NO" ] || rc_err "$0: $1 is not supported"