2.dhcpd.sh.in 790 Bytes
Newer Older
1 2 3 4
#!/bin/sh
#
# Wrapper for DHCPD which has a habit of dying. 
#
5
elabinelab="@ELABINELAB@"
Leigh B Stoller's avatar
Leigh B Stoller committed
6
configfile="/usr/local/etc/dhcpd.conf"
7
extraifs="@DHCPD_EXTRAIFS@"
8
case "$1" in
9
	start|faststart|quietstart|onestart|forcestart)
10 11
		# limit to control network
		cnetif=
12
		if [ $elabinelab != "1" -a -x @prefix@/sbin/findif ]; then
13 14
		    cnetif=`@prefix@/sbin/findif -i @BOSSNODE_IP@`
		fi
15 16 17
		if [ -x @prefix@/sbin/daemon_wrapper ]; then
			echo -n " dhcpd wrapper"
			@prefix@/sbin/daemon_wrapper \
18
			  /usr/local/sbin/dhcpd -f $cnetif $extraifs -cf $configfile
19 20
		fi
		;;
21
	stop|faststop|quietstop|onestop|forcestop)
22 23 24 25 26 27 28 29 30 31 32
		if [ -r /var/run/dhcpd_wrapper.pid ]; then
			kill `cat /var/run/dhcpd_wrapper.pid`
		fi
		;;
	*)
		echo ""
		echo "Usage: `basename $0` { start | stop }"
		echo ""
		exit 64
		;;
esac