3 # $Id: dhcp3-relay,v 1.1 2004/04/16 15:41:08 ml Exp $
6 # What servers should the DHCP relay forward requests to?
7 # e.g: SERVERS="192.168.0.1"
10 # On what interfaces should the DHCP relay (dhrelay) serve DHCP requests?
13 # Additional options that are passed to the DHCP relay daemon?
17 test -f /usr/sbin/dhcrelay || exit 0
18 test -n "$INTERFACES" || exit 0
19 test -n "$SERVERS" || exit 0
21 # Build command line for interfaces (will be passed to dhrelay below.)
23 for I in $INTERFACES; do
24 IFCMD=${IFCMD}"-i "${I}" "
27 DHCRELAYPID=/var/run/dhcrelay.pid
31 echo -n "Starting DHCP relay: "
32 start-stop-daemon -S -x /usr/sbin/dhcrelay -- -q $OPTIONS $IFCMD $SERVERS
33 [ $? = 0 ] && echo "OK" || echo "FAIL"
36 echo -n "Stopping DHCP relay: "
37 start-stop-daemon -K -x /usr/sbin/dhcrelay
38 [ $? = 0 ] && echo "OK" || echo "FAIL"
40 restart | force-reload)
46 echo "Usage: /etc/init.d/dhcp-relay {start|stop|restart|force-reload}"