#!/bin/sh
#
# dhcpd      This shell script takes care of starting and stopping
#             dhcpd.
#
# chkconfig: - 65 35
# description: DHCP is a protocol extension to BOOTP that allows \
# for the use of dynamic IP and other network data.  This package \
# is the server necessary to fulfill DHCP requests from other machines.

# Source function library.
. /etc/rc.d/init.d/functions

# Source networking configuration.
. /etc/sysconfig/network

# Check that networking is up.
[ ${NETWORKING} = "no" ] && exit 0

[ -f /usr/sbin/dhcpd ] || exit 0

# See how we were called.
case "$1" in
  start)
	# Start daemons.
	echo -n "Starting dhcpd: "
	daemon dhcpd -q
	echo
	;;
  stop)
	# Stop daemons.
	echo -n "Shutting down dhcpd "
	killproc dhcpd
	echo
	;;
  status)
	status dhcpd
	;;
  restart)
	$0 stop
	$0 start
	;;
  *)
	echo "Usage: dhcpd start|stop|restart|status"
	exit 1
esac

exit 0

