aboutsummaryrefslogtreecommitdiffstats
path: root/net/isc-dhcp2
diff options
context:
space:
mode:
authorshige <shige@FreeBSD.org>2001-04-21 02:31:53 +0800
committershige <shige@FreeBSD.org>2001-04-21 02:31:53 +0800
commit7bf0500224ffb83e5776a2495bb245873885477d (patch)
tree48d48eac7201a96300b74984436ad638985af98e /net/isc-dhcp2
parentb61ecbec4be39b6113580cf435a71e28dda32927 (diff)
downloadfreebsd-ports-gnome-7bf0500224ffb83e5776a2495bb245873885477d.tar.gz
freebsd-ports-gnome-7bf0500224ffb83e5776a2495bb245873885477d.tar.zst
freebsd-ports-gnome-7bf0500224ffb83e5776a2495bb245873885477d.zip
Add a sample startup script for dhcpd.
Diffstat (limited to 'net/isc-dhcp2')
-rw-r--r--net/isc-dhcp2/Makefile5
-rw-r--r--net/isc-dhcp2/files/isc-dhcpd.sh.sample48
-rw-r--r--net/isc-dhcp2/pkg-plist1
3 files changed, 54 insertions, 0 deletions
diff --git a/net/isc-dhcp2/Makefile b/net/isc-dhcp2/Makefile
index 8b7c0854b157..f314562620c5 100644
--- a/net/isc-dhcp2/Makefile
+++ b/net/isc-dhcp2/Makefile
@@ -16,6 +16,9 @@ MAINTAINER= jseger@FreeBSD.org
HAS_CONFIGURE= yes
+STARTUP_SCRIPT= isc-dhcpd.sh.sample
+PLIST_SUB= STARTUP_SCRIPT=${STARTUP_SCRIPT}
+
MAN5= dhcp-options.5 dhcpd.conf.5 dhcpd.leases.5
MAN8= dhcpd.8 dhcrelay.8
@@ -29,5 +32,7 @@ post-install:
strip ${PREFIX}/sbin/${file}; \
fi
.endfor
+ ${INSTALL_SCRIPT} ${FILESDIR}/${STARTUP_SCRIPT} \
+ ${PREFIX}/etc/rc.d/${STARTUP_SCRIPT}
.include <bsd.port.mk>
diff --git a/net/isc-dhcp2/files/isc-dhcpd.sh.sample b/net/isc-dhcp2/files/isc-dhcpd.sh.sample
new file mode 100644
index 000000000000..2c047ce00bcb
--- /dev/null
+++ b/net/isc-dhcp2/files/isc-dhcpd.sh.sample
@@ -0,0 +1,48 @@
+#!/bin/sh
+# $FreeBSD$
+# startup scripts for ISC DHCPD.
+
+if ! PREFIX=$(expr $0 : "\(/.*\)/etc/rc\.d/$(basename $0)\$"); then
+ echo "$0: Cannot determine the PREFIX" >&2
+ exit 1
+fi
+
+# If there is a global system configuration file, suck it in.
+if [ -r /etc/defaults/rc.conf ]; then
+ . /etc/defaults/rc.conf
+ source_rc_confs
+elif [ -r /etc/rc.conf ]; then
+ . /etc/rc.conf
+fi
+
+isc_dhcpd_enable=${isc_dhcpd_enable:-YES}
+isc_dhcpd_program=${isc_dhcpd_program:-${PREFIX}/sbin/dhcpd}
+isc_dhcpd_flags=${isc_dhcpd_flags:-'-q'}
+isc_dhcpd_pidfile=${isc_dhcpd_pidfile:-/var/run/dhcpd.pid}
+
+case $1 in
+start)
+ case "${isc_dhcpd_enable}" in
+ [Yy][Ee][Ss])
+ if [ -f ${isc_dhcpd_program} ]; then
+ echo -n " isc-dhcpd"
+ ${isc_dhcpd_program} ${isc_dhcpd_flags}
+ fi
+ ;;
+ esac
+ ;;
+stop)
+ if [ -f ${isc_dhcpd_pidfile} ]; then
+ PID=`cat ${isc_dhcpd_pidfile}`
+ kill -KILL $PID
+ fi
+ ;;
+retstart)
+ $0 stop && $0 start;
+ ;;
+*)
+ echo "usage: $0 {start|stop|restart}" 1>&2
+ ;;
+esac
+
+exit 0;
diff --git a/net/isc-dhcp2/pkg-plist b/net/isc-dhcp2/pkg-plist
index 576a2be0296d..901e978ad1f2 100644
--- a/net/isc-dhcp2/pkg-plist
+++ b/net/isc-dhcp2/pkg-plist
@@ -1,4 +1,5 @@
sbin/dhcpd
sbin/dhcrelay
+etc/rc.d/%%STARTUP_SCRIPT%%
@exec touch /var/db/dhcpd.leases
@exec touch %D/etc/dhclient.conf