add mc
[buildroot.git] / package / dhcp / S80dhcp-server
blob7c7f893a149a12ff9073b4d1cba90ea4b1b8e93b
1 #!/bin/sh
3 # $Id: dhcp3-server.init.d,v 1.4 2003/07/13 19:12:41 mdz Exp $
8 # On what interfaces should the DHCP server (dhcpd) serve DHCP requests?
9 # Separate multiple interfaces with spaces, e.g. "eth0 eth1".
10 INTERFACES=""
13 # It is not safe to start if we don't have a default configuration...
14 echo "/etc/init.d/dhcp-server not yet configured! - Aborting..."
15 exit 1;
19 test -f /usr/sbin/dhcpd || exit 0
22 case "$1" in
23 start)
24 echo -n "Starting DHCP server: "
25 test -d /var/lib/dhcp/ || mkdir -p /var/lib/dhcp/
26 test -f /var/lib/dhcp/dhcpd.leases || touch /var/lib/dhcp/dhcpd.leases
27 start-stop-daemon -S -x /usr/sbin/dhcpd -- -q $INTERFACES
28 echo "."
30 stop)
31 echo -n "Stopping DHCP server: dhcpd3"
32 start-stop-daemon -K -x /usr/sbin/dhcpd
33 echo "."
35 restart | force-reload)
36 $0 stop
37 sleep 2
38 $0 start
39 if [ "$?" != "0" ]; then
40 exit 1
44 echo "Usage: /etc/init.d/dhcp-server {start|stop|restart|force-reload}"
45 exit 1
46 esac
48 exit 0