5 # description: DHCP Server
7 # Source function library
8 . /etc/rc.d/init.d/functions
11 . /etc/sysconfig/network
14 [ -f /etc/sysconfig/dhcpd ] && . /etc/sysconfig/dhcpd
16 # Check that networking is up.
17 if is_yes "${NETWORKING}"; then
18 if [ ! -f /var/lock/subsys/network -a "$1" != stop -a "$1" != status ]; then
19 msg_network_down "DHCP Server"
27 show "Checking %s configuration" "DHCP Server"
28 out=`/usr/sbin/dhcpd -t 2>&1`; rc=$?
29 if [ $rc -gt 0 ]; then
39 # Check if the service is already running?
40 if [ ! -f /var/lock/subsys/dhcpd ]; then
41 msg_starting "DHCP Server"
42 daemon dhcpd $DHCPD_INTERFACES
44 [ $RETVAL -eq 0 ] && touch /var/lock/subsys/dhcpd
46 msg_already_running "DHCP Server"
51 if [ -f /var/lock/subsys/dhcpd ]; then
52 msg_stopping "DHCP Server"
54 rm -f /var/run/dhcpd.pid /var/lock/subsys/dhcpd >/dev/null 2>&1
56 msg_not_running "DHCP Server"
61 # See how we were called.
83 msg_usage "$0 {start|stop|restart|checkconfig|status}"