python-pyasn: bump to version 1.6.0b1
[buildroot-gz.git] / package / dhcp / S80dhcp-relay
blob211431bfff2830ad254f597e7f5d841c1646c99c
1 #!/bin/sh
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"
8 SERVERS=""
10 # On what interfaces should the DHCP relay (dhrelay) serve DHCP requests?
11 INTERFACES=""
13 # Additional options that are passed to the DHCP relay daemon?
14 OPTIONS=""
16 # Read configuration variable file if it is present
17 CFG_FILE="/etc/default/dhcrelay"
18 [ -r "${CFG_FILE}" ] && . "${CFG_FILE}"
20 # Sanity checks
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.)
26 IFCMD=""
27 for I in $INTERFACES; do
28 IFCMD=${IFCMD}"-i "${I}" "
29 done
31 DHCRELAYPID=/var/run/dhcrelay.pid
33 case "$1" in
34 start)
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"
39 stop)
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)
45 $0 stop
46 $0 start
49 echo "Usage: $0 {start|stop|restart|force-reload}"
50 exit 1
51 esac
53 exit 0