summaryrefslogtreecommitdiffstats
path: root/meta/recipes-connectivity/dhcp/files/init-relay
diff options
context:
space:
mode:
Diffstat (limited to 'meta/recipes-connectivity/dhcp/files/init-relay')
-rw-r--r--meta/recipes-connectivity/dhcp/files/init-relay44
1 files changed, 44 insertions, 0 deletions
diff --git a/meta/recipes-connectivity/dhcp/files/init-relay b/meta/recipes-connectivity/dhcp/files/init-relay
new file mode 100644
index 0000000000..019a7e84cf
--- /dev/null
+++ b/meta/recipes-connectivity/dhcp/files/init-relay
@@ -0,0 +1,44 @@
1#!/bin/sh
2#
3# $Id: dhcp3-relay,v 1.1 2004/04/16 15:41:08 ml Exp $
4#
5
6# It is not safe to start if we don't have a default configuration...
7if [ ! -f /etc/default/dhcp-relay ]; then
8 echo "/etc/default/dhcp-relay does not exist! - Aborting..."
9 echo "create this file to fix the problem."
10 exit 1
11fi
12
13# Read init script configuration (interfaces the daemon should listen on
14# and the DHCP server we should forward requests to.)
15. /etc/default/dhcp-relay
16
17# Build command line for interfaces (will be passed to dhrelay below.)
18IFCMD=""
19if test "$INTERFACES" != ""; then
20 for I in $INTERFACES; do
21 IFCMD=${IFCMD}"-i "${I}" "
22 done
23fi
24
25DHCRELAYPID=/var/run/dhcrelay.pid
26
27case "$1" in
28 start)
29 start-stop-daemon -S -x /usr/sbin/dhcrelay -- -q $OPTIONS $IFCMD $SERVERS
30 ;;
31 stop)
32 start-stop-daemon -K -x /usr/sbin/dhcrelay
33 ;;
34 restart | force-reload)
35 $0 stop
36 sleep 2
37 $0 start
38 ;;
39 *)
40 echo "Usage: /etc/init.d/dhcp-relay {start|stop|restart|force-reload}"
41 exit 1
42esac
43
44exit 0