#!/bin/sh # # Start/stop/restart dhcpd # # # 12-Mar-05 amo Date-of-Birth # # # DHCPD=/usr/sbin/dhcpd # CONF="/etc/dhcpd.conf" # LEASE="/var/state/dhcp" # LISTEN_IF=eth0 # # # Start dhcpd # dhcpd_start() { # if [ ! -f "$CONF" ]; then echo "#" echo "# ABORTING : ERROR: Missing conf=$CONF" echo "#" # exit 1 fi # if [ ! -d "$LEASE" ]; then echo "#" echo "# WARNING: Missing LeaseDir=$LEASE.." echo "#" # exit 1 fi # # # Start dhcpd # ----------- # $DHCPD -cf $CONF -q $LISTEN_IF # $0 status # } # start # # # Stop dhcpd # dhcpd_stop() { # killall dhcpd # $0 status # } # stop # # # dhcpd_restart() { # dhcpd_stop sleep 1 dhcpd_start # } # # case "$1" in # 'start') dhcpd_start ;; # 'stop') dhcpd_stop ;; # 'status') # ps axuw | grep dhcp | grep -iv status # ;; # 'restart') dhcpd_restart ;; # *) # echo "usage $0 start|stop|status|restart" # esac # # End of file