dhcpd(8) has
     -n      Only test configuration, do not run dhcpd.

rc_configtest() taken from other rc.d scripts.

Feedback? OK?

Index: dhcpd
===================================================================
RCS file: /cvs/src/etc/rc.d/dhcpd,v
retrieving revision 1.3
diff -u -p -r1.3 dhcpd
--- dhcpd       11 Jan 2018 19:52:12 -0000      1.3
+++ dhcpd       29 Sep 2022 20:52:28 -0000
@@ -6,6 +6,11 @@ daemon="/usr/sbin/dhcpd"
 
 . /etc/rc.d/rc.subr
 
+rc_configtest() {
+       # use rc_exec here since daemon_flags may contain arguments with spaces
+       rc_exec "${daemon} -n ${daemon_flags}"
+}
+
 rc_reload=NO
 
 rc_pre() {

Reply via email to