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