]> git.pld-linux.org Git - packages/dhcp.git/blame - dhcp-relay.init
- updated to 3.0pl2: security fix.
[packages/dhcp.git] / dhcp-relay.init
CommitLineData
332ceb62 1#!/bin/sh
a5333732 2# DHCP relay agent
332ceb62 3#
31822625 4# chkconfig: 345 80 20
a5333732 5# description: DHCP relay agent
332ceb62 6
7# Source function library.
8. /etc/rc.d/init.d/functions
9
3b314dfa
JR
10# Source networking configuration.
11. /etc/sysconfig/network
12
13# Demon specified configuration.
14. /etc/sysconfig/dhcp-relay
332ceb62 15
3b314dfa
JR
16# Check that networking is up.
17if is_no "${NETWORKING}"; then
a5333732 18 msg_Network_Down "DHCP realay"
3b314dfa
JR
19 exit 1
20fi
332ceb62 21
dde046a6 22if [ -n "DHCP_REALY_INTERFACES" ]; then
23 OPTIONS="-i $DHCP_REALY_INTERFACES"
24fi
25
26
332ceb62 27# See how we were called.
28case "$1" in
29 start)
a5333732 30 # Check if the service is already running?
6dfd82ed 31 if [ ! -f /var/lock/subsys/dhcp-relay ]; then
a5333732 32 msg_starting "DHCP relay"
33 daemon dhcrelay $OPTIONS $DHCP_SERVERS_IP
34 RETVAL=$?
6dfd82ed 35 [ $RETVAL -eq 0 ] && touch /var/lock/subsys/dhcp-relay
a5333732 36 else
37 msg_Already_Running "DHCP relay"
38 exit 1
13f26ef2 39 fi
332ceb62 40 ;;
41 stop)
a5333732 42 msg_stopping "DHCP relay"
a0aeec5e 43 killproc dhcrelay
6dfd82ed 44 rm -f /var/lock/subsys/dhcp-relay
332ceb62 45 ;;
a5333732 46 restart|reload)
332ceb62 47 $0 stop
48 $0 start
49 ;;
50 status)
ddd9a79d 51 status dhcrelay
332ceb62 52 ;;
53 *)
a5333732 54 msg_Usage "$0 {start|stop|restart|reload|status}"
332ceb62 55 exit 1
56esac
57
a5333732 58exit $RETVAL
This page took 0.060447 seconds and 4 git commands to generate.