dhcpd 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. #!/bin/sh
  2. ########################################################################
  3. # Begin dhcpd
  4. #
  5. # Description : ISC DHCP Server Boot Script.
  6. #
  7. # Author :
  8. #
  9. # Version : LFS 7.0
  10. #
  11. ########################################################################
  12. ### BEGIN INIT INFO
  13. # Provides: dhcpd
  14. # Required-Start: network
  15. # Required-Stop: sendsignals
  16. # Default-Start: 2 3 4 5
  17. # Default-Stop: 0 2 6
  18. # Short-Description: Starts the ISC DHCP Server.
  19. # X-LFS-Provided-By: BLFS
  20. ### END INIT INFO
  21. . /etc/rc.d/functions
  22. #$LastChangedBy: krejzi $
  23. #$Date: 2013-06-11 10:49:17 -0500 (Tue, 11 Jun 2013) $
  24. INTERFACES=""
  25. OPTIONS=""
  26. if [ -f "/etc/sysconfig/dhcpd" ]; then
  27. . /etc/sysconfig/dhcpd
  28. fi
  29. case "$1" in
  30. start)
  31. if [ -z "$INTERFACES" ]; then
  32. MSG="You need to configure dhcp server in"
  33. log_warning_msg "$MSG /etc/sysconfig/dhcpd"
  34. exit 0
  35. fi
  36. log_info_msg "Starting ISC DHCP Server dhcpd"
  37. start_daemon /usr/sbin/dhcpd -q $INTERFACES $OPTIONS
  38. evaluate_retval
  39. ;;
  40. stop)
  41. log_info_msg "Stopping ISC DHCP Server dhcpd"
  42. killproc /usr/sbin/dhcpd
  43. evaluate_retval
  44. ;;
  45. restart)
  46. $0 stop
  47. sleep 1
  48. $0 start
  49. ;;
  50. status)
  51. statusproc /usr/sbin/dhcpd
  52. ;;
  53. *)
  54. echo "Usage: $0 {start|stop|restart|status}"
  55. exit 1
  56. ;;
  57. esac
  58. # End /etc/init.d/dhcpd