]> git.ipfire.org Git - people/teissler/ipfire-2.x.git/blob - src/initscripts/init.d/dhcrelay
Merge remote-tracking branch 'morlix/check_mk'
[people/teissler/ipfire-2.x.git] / src / initscripts / init.d / dhcrelay
1 #!/bin/sh
2 ########################################################################
3 # Begin $rc_base/init.d/dhcrelay
4 #
5 # Description : The DHCP Relay Daemon
6 #
7 ########################################################################
8
9 . /etc/sysconfig/rc
10 . ${rc_functions}
11
12 CONFIG_FILE="/var/ipfire/dhcp/relay"
13
14 if [ -r "${CONFIG_FILE}" ]; then
15 eval $(/usr/local/bin/readhash ${CONFIG_FILE})
16 fi
17
18 ARGS="-q"
19
20 for interface in ${INTERFACES}; do
21 ARGS="${ARGS} -i ${interface}"
22 done
23
24 ARGS="${ARGS} ${SERVERS}"
25
26 case "${1}" in
27 start)
28 boot_mesg "Starting DHCP Relay..."
29 loadproc /usr/sbin/dhcrelay ${ARGS}
30 ;;
31
32 stop)
33 boot_mesg "Stopping DHCP Relay..."
34 killproc -p /var/run/dhcrelay.pid /usr/sbin/dhcrelay
35 ;;
36
37 restart)
38 ${0} stop
39 sleep 1
40 ${0} start
41 ;;
42
43 status)
44 statusproc /usr/sbin/dhcrelay
45 ;;
46
47 *)
48 echo "Usage: ${0} {start|stop|restart|status}"
49 exit 1
50 ;;
51 esac
52
53 # End $rc_base/init.d/dhcrelay