summaryrefslogtreecommitdiff
path: root/net/isc-dhcp4/files/isc_dhcpd.sh
diff options
context:
space:
mode:
Diffstat (limited to 'net/isc-dhcp4/files/isc_dhcpd.sh')
-rwxr-xr-xnet/isc-dhcp4/files/isc_dhcpd.sh36
1 files changed, 36 insertions, 0 deletions
diff --git a/net/isc-dhcp4/files/isc_dhcpd.sh b/net/isc-dhcp4/files/isc_dhcpd.sh
new file mode 100755
index 00000000000..5ad79967233
--- /dev/null
+++ b/net/isc-dhcp4/files/isc_dhcpd.sh
@@ -0,0 +1,36 @@
+#!@RCD_SCRIPTS_SHELL@
+#
+# $NetBSD: isc_dhcpd.sh,v 1.1.1.1 2008/02/13 22:03:58 adrianp Exp $
+#
+
+# PROVIDE: dhcpd
+# REQUIRE: DAEMON
+# BEFORE: LOGIN
+
+if [ -f /etc/rc.subr ]; then
+ . /etc/rc.subr
+fi
+
+name="dhcpd"
+rcvar="isc_${name}"
+command="@PREFIX@/sbin/${name}"
+pidfile="@VARBASE@/run/isc-dhcp/isc-${name}.pid"
+required_files="@PKG_SYSCONFDIR@/${name}.conf"
+start_precmd="isc_dhcpd_precmd"
+
+isc_dhcpd_precmd()
+{
+ if [ ! -d @VARBASE@/run/isc-dhcp ]; then
+ @MKDIR@ @VARBASE@/run/isc-dhcp
+ @CHMOD@ 0770 @VARBASE@/run/isc-dhcp
+ fi
+
+ if [ ! -f @DHCP_HOME@/dhcpd.leases ]; then
+ @MKDIR@ @DHCP_HOME@
+ @TOUCH@ @DHCP_HOME@/dhcpd.leases
+ @CHMOD@ 0640 @DHCP_HOME@/dhcpd.leases
+ fi
+}
+
+load_rc_config $rcvar
+run_rc_command "$1"