summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKlemens Nanni <kn@cvs.openbsd.org>2024-09-23 20:54:02 +0000
committerKlemens Nanni <kn@cvs.openbsd.org>2024-09-23 20:54:02 +0000
commit9449f74855fc7b7ecff8bd720c7b5620952957bb (patch)
treef7f5360f66a95e01db19c1be5e6f21f1d4bc367b
parent6680bd9b8deb301bf24a6e65ed81347656c992f7 (diff)
Replace `&&' with `if' for proper $? handling; OK lucas
iked and isakmpd guard against themselves with "return 0" as rc.subr(8) checks rc_pre()'s return code and aborts daemo start iff non-zero, but that isn't needed if we use ksh properly.
-rw-r--r--etc/rc.d/iked7
-rw-r--r--etc/rc.d/isakmpd6
2 files changed, 7 insertions, 6 deletions
diff --git a/etc/rc.d/iked b/etc/rc.d/iked
index 44861ace985..005e57829d1 100644
--- a/etc/rc.d/iked
+++ b/etc/rc.d/iked
@@ -1,6 +1,6 @@
#!/bin/ksh
#
-# $OpenBSD: iked,v 1.10 2022/09/04 06:57:13 ajacoutot Exp $
+# $OpenBSD: iked,v 1.11 2024/09/23 20:54:01 kn Exp $
daemon="/sbin/iked"
@@ -12,10 +12,11 @@ rc_configtest() {
# use rc_exec here since daemon_flags may contain arguments with spaces
rc_exec "${daemon} -n ${daemon_flags}"
}
+
rc_pre() {
- [[ ${sasyncd_flags} != NO ]] &&
+ if [[ ${sasyncd_flags} != NO ]]; then
daemon_flags="-S ${daemon_flags}"
- return 0
+ fi
}
rc_cmd $1
diff --git a/etc/rc.d/isakmpd b/etc/rc.d/isakmpd
index 1f554005b9c..559d0af3edd 100644
--- a/etc/rc.d/isakmpd
+++ b/etc/rc.d/isakmpd
@@ -1,6 +1,6 @@
#!/bin/ksh
#
-# $OpenBSD: isakmpd,v 1.3 2018/01/11 21:09:26 rpe Exp $
+# $OpenBSD: isakmpd,v 1.4 2024/09/23 20:54:01 kn Exp $
daemon="/sbin/isakmpd"
@@ -9,9 +9,9 @@ daemon="/sbin/isakmpd"
pexp="isakmpd: monitor \[priv\]"
rc_pre() {
- [[ ${sasyncd_flags} != NO ]] &&
+ if [[ ${sasyncd_flags} != NO ]]; then
daemon_flags="-S ${daemon_flags}"
- return 0
+ fi
}
rc_cmd $1