2.dhcpd.sh.in 712 Bytes
Newer Older
1 2 3 4
#!/bin/sh
#
# Wrapper for DHCPD which has a habit of dying. 
#
5
elabinelab="@ELABINELAB@"
Leigh Stoller's avatar
Leigh Stoller committed
6
configfile="/usr/local/etc/dhcpd.conf"
7
extraifs="@DHCPD_EXTRAIFS@"
8 9
case "$1" in
	start)
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 21 22 23 24 25 26 27 28 29 30 31 32
		fi
		;;
	stop)
		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