S80dhcp-relay 1015 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. #!/bin/sh
  2. #
  3. # $Id: dhcp3-relay,v 1.1 2004/04/16 15:41:08 ml Exp $
  4. #
  5. # What servers should the DHCP relay forward requests to?
  6. # e.g: SERVERS="192.168.0.1"
  7. SERVERS=""
  8. # On what interfaces should the DHCP relay (dhrelay) serve DHCP requests?
  9. INTERFACES=""
  10. # Additional options that are passed to the DHCP relay daemon?
  11. OPTIONS=""
  12. # It is not safe to start if we don't have a default configuration...
  13. echo "/etc/init.d/dhcp-relay not yet configured! - Aborting..."
  14. exit 1;
  15. # Build command line for interfaces (will be passed to dhrelay below.)
  16. IFCMD=""
  17. if test "$INTERFACES" != ""; then
  18. for I in $INTERFACES; do
  19. IFCMD=${IFCMD}"-i "${I}" "
  20. done
  21. fi
  22. DHCRELAYPID=/var/run/dhcrelay.pid
  23. case "$1" in
  24. start)
  25. start-stop-daemon -S -x /usr/sbin/dhcrelay -- -q $OPTIONS $IFCMD $SERVERS
  26. ;;
  27. stop)
  28. start-stop-daemon -K -x /usr/sbin/dhcrelay
  29. ;;
  30. restart | force-reload)
  31. $0 stop
  32. sleep 2
  33. $0 start
  34. ;;
  35. *)
  36. echo "Usage: /etc/init.d/dhcp-relay {start|stop|restart|force-reload}"
  37. exit 1
  38. esac
  39. exit 0