#!/bin/sh
#
# dhcpd         This shell script takes care of starting and stopping
#               dhcpd.
#
# chkconfig: 2345 65 35
# description: dhcpd provide access to Dynamic Host Control Protocol.

# 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
[ -f /etc/dhcpd.conf ] || exit 0

# See how we were called.
case "$1" in
  start)
	# Start daemons.
	echo -n "Starting dhcpd: "
	daemon /usr/sbin/dhcpd
	echo
	touch /var/lock/subsys/dhcpd
	;;
  stop)
	# Stop daemons.
	echo -n "Shutting down dhcpd: "
	killproc dhcpd
	echo
	rm -f /var/lock/subsys/dhcpd
	;;
  restart)
	$0 stop
	$0 start
	;;
  status)
	status dhcpd
	;;
  *)
	echo "Usage: dhcpd {start|stop|restart|status}"
	exit 1
esac

exit 0

