#!/sbin/sh
#
# Copyright (c) 1996-2001 by Sun Microsystems, Inc.
# All rights reserved.
#
#ident	"@(#)dhcp	1.18	01/02/28 SMI"

# Make sure that /usr is mounted
[ ! -d /usr/bin ] && exit 1

case "$1" in
'start')
	if [ -x /usr/lib/inet/in.dhcpd ]; then
		if [ -f /etc/inet/dhcpsvc.conf ]; then
			eval `grep '^DAEMON_ENABLED=' /etc/inet/dhcpsvc.conf`
			GO=`echo ${DAEMON_ENABLED} | /usr/bin/cut -c1`
			if [ "${GO}" = "t" -o "${GO}" = "T" ]; then
				/usr/lib/inet/in.dhcpd > /dev/console 2>&1
			fi
		fi
	fi
	;;

'stop')
	/usr/bin/pkill -x -u 0 in.dhcpd
	;;

*)
	echo "Usage: $0 { start | stop }"
	exit 1
	;;
esac
exit 0
