S80dhcp-server 987 B

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