add mc
[buildroot.git] / package / dhcp / S80dhcp-relay
blobc870ea7f5d63b66a93e13c3f65e567879642347a
1 #!/bin/sh
3 # $Id: dhcp3-relay,v 1.1 2004/04/16 15:41:08 ml Exp $
7 # What servers should the DHCP relay forward requests to?
8 # e.g: SERVERS="192.168.0.1"
9 SERVERS=""
11 # On what interfaces should the DHCP relay (dhrelay) serve DHCP requests?
12 INTERFACES=""
14 # Additional options that are passed to the DHCP relay daemon?
15 OPTIONS=""
20 # It is not safe to start if we don't have a default configuration...
21 echo "/etc/init.d/dhcp-relay not yet configured! - Aborting..."
22 exit 1;
26 # Build command line for interfaces (will be passed to dhrelay below.)
27 IFCMD=""
28 if test "$INTERFACES" != ""; then
29 for I in $INTERFACES; do
30 IFCMD=${IFCMD}"-i "${I}" "
31 done
34 DHCRELAYPID=/var/run/dhcrelay.pid
36 case "$1" in
37 start)
38 start-stop-daemon -S -x /usr/sbin/dhcrelay -- -q $OPTIONS $IFCMD $SERVERS
40 stop)
41 start-stop-daemon -K -x /usr/sbin/dhcrelay
43 restart | force-reload)
44 $0 stop
45 sleep 2
46 $0 start
49 echo "Usage: /etc/init.d/dhcp-relay {start|stop|restart|force-reload}"
50 exit 1
51 esac
53 exit 0