dhcp/dhcpd-initscript

50 lines
957 B
Bash

#!/bin/sh
# Begin $rc_base/init.d/dhcp
# Based on sysklogd script from LFS-3.1 and earlier.
# Rewritten by Gerard Beekmans - gerard@linuxfromscratch.org
# Modified by Silvan Calarco <silvan.calarco@mambasoft.it>
# Modified by Davide Madrisan <davide.madrisan@qilinux.it>
#
# chkconfig: 345 55 15
# description: The ISC DHCP (Dynamic Host Configuration Protocol) client
. /etc/sysconfig/rc
. $rc_functions
. $rc_networkfunctions
. /etc/sysconfig/dhcpd
. /etc/sysconfig/network
case "$1" in
start)
echo -n "Starting DHCP Server..."
for interface in $DHCPDIFS; do
loadproc dhcpd -q $interface $DHCPDARGS
done
echo
;;
stop)
echo -n "Stopping DHCP Server..."
killproc dhcpd
echo
;;
restart)
$0 stop
sleep 1
$0 start
;;
status)
statusproc dhcpd
;;
*)
echo "Usage: $0 {start|stop|restart|status}"
exit 1
;;
esac
# End $rc_base/init.d/dhcp