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?
16 # Read configuration variable file if it is present
17 CFG_FILE
="/etc/default/dhcrelay"
18 [ -r "${CFG_FILE}" ] && .
"${CFG_FILE}"
21 test -f /usr
/sbin
/dhcrelay ||
exit 0
22 test -n "$INTERFACES" ||
exit 0
23 test -n "$SERVERS" ||
exit 0
25 # Build command line for interfaces (will be passed to dhrelay below.)
27 for I
in $INTERFACES; do
28 IFCMD
=${IFCMD}"-i "${I}" "
31 DHCRELAYPID
=/var
/run
/dhcrelay.pid
35 printf "Starting DHCP relay: "
36 start-stop-daemon
-S -q -x /usr
/sbin
/dhcrelay
-- -q $OPTIONS $IFCMD $SERVERS
37 [ $?
= 0 ] && echo "OK" ||
echo "FAIL"
40 printf "Stopping DHCP relay: "
41 start-stop-daemon
-K -q -x /usr
/sbin
/dhcrelay
42 [ $?
= 0 ] && echo "OK" ||
echo "FAIL"
44 restart | force-reload
)
49 echo "Usage: $0 {start|stop|restart|force-reload}"