#!/bin/sh # # /etc/rc.d/rc.dhcpd # This shell script takes care of starting and stopping # the ISC DHCPD service # # Put the command line options here that you want to pass to dhcpd: DHCPD_OPTIONS="-q eth0" [ -x /usr/sbin/dhcpd ] || exit 0 [ -f /etc/dhcpd.conf ] || exit 0 start() { # Start daemons. echo -n "Starting dhcpd: /usr/sbin/dhcpd $DHCPD_OPTIONS " /usr/sbin/dhcpd $DHCPD_OPTIONS echo } stop() { # Stop daemons. echo -n "Shutting down dhcpd: " killall -TERM dhcpd echo } status() { PIDS=$(pidof dhcpd) if [ "$PIDS" == "" ]; then echo "dhcpd is not running!" else echo "dhcpd is running at pid(s) ${PIDS}." fi } restart() { stop start } # See how we were called. case "$1" in start) start ;; stop) stop ;; restart) stop start ;; status) status ;; *) echo "Usage: $0 {start|stop|status|restart}" ;; esac exit 0