summaryrefslogtreecommitdiff
path: root/net/isc-dhcp2/files
diff options
context:
space:
mode:
Diffstat (limited to 'net/isc-dhcp2/files')
-rw-r--r--net/isc-dhcp2/files/isc-dhcpd.sh.sample48
1 files changed, 48 insertions, 0 deletions
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;