#! /bin/sh # # udhcpd This shell script takes care of starting and stopping # udhcpd # # chkconfig: 345 65 35 # description: udhcpd - A very small DHCP Server # probe: true # pidfile: /var/run/udhcpd.pid # config: /etc/udhcpd.conf ### BEGIN INIT INFO # Provides: udhcpd # Required-Start: $network # Required-Stop: $network # Default-Start: 3 4 5 # Default-Stop: 0 1 6 # Short-Description: Start/Stop the udhcpd daemon. # Description: udhcpd - A very small DHCP Server ### END INIT INFO PATH=/sbin:/bin:/usr/sbin:/usr/bin export PATH # 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 /etc/udhcpd.conf ] || exit 0 DAEMON=/usr/sbin/udhcpd NAME=udhcpd DESC=udhcpd test -x $DAEMON || exit 0 case "$1" in start) echo -n "Starting $DESC: " daemon $DAEMON RETVAL=$? echo [ $RETVAL -eq 0 ] && touch /var/lock/subsys/$NAME ;; stop) echo -n "Stopping $DESC: " killproc $DAEMON RETVAL=$? echo [ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/$NAME ;; status) status $DAEMON ;; restart|force-reload|reload) echo -n "Restarting $DESC: " echo $0 stop $0 start RETVAL=$? ;; *) echo "Usage: $0 {start|stop|restart|force-reload|reload|status}" exit 1 ;; esac exit $RETVAL