/[packages]/cauldron/dhcp/current/SOURCES/dhcrelay.init
ViewVC logotype

Annotation of /cauldron/dhcp/current/SOURCES/dhcrelay.init

Parent Directory Parent Directory | Revision Log Revision Log


Revision 16733 - (hide annotations) (download)
Thu Jan 13 23:42:18 2011 UTC (13 years, 3 months ago) by dmorgan
File size: 2120 byte(s)
imported package dhcp
1 dmorgan 16733 #!/bin/sh
2     #
3     # dhcrelay This shell script takes care of starting and stopping
4     # dhcrelay.
5     #
6     # chkconfig: 2345 65 35
7     # description: dhcrelay provides the DHCP Relay service.
8     #
9     # processname: dhcrelay
10     # pidfile: /var/run/dhcrelay.pid
11     #
12     ### BEGIN INIT INFO
13     # Provides: dhcrelay
14     # Required-Start: $network
15     # Required-Stop: $network
16     # Default-Start: 2 3 4 5
17     # Short-Description: The dhcrelay daemon
18     # Description: dhcrelay provides the DHCP Relay service.
19     ### END INIT INFO
20    
21     # Source function library.
22     . /etc/rc.d/init.d/functions
23    
24     # Source networking configuration.
25     . /etc/sysconfig/network
26    
27     # Check that networking is up.
28     [ ${NETWORKING} = "no" ] && exit 0
29    
30     [ -x /usr/sbin/dhcrelay ] || exit 0
31    
32     # The following variables can be set in the file
33     # /etc/sysconfig/dhcrelay.
34    
35     # Define SERVERS with a list of one or more DHCP servers where
36     # DHCP packets are to be relayed to and from. This is mandatory.
37     #SERVERS="10.11.12.13 10.9.8.7"
38     SERVERS=""
39    
40     # Define OPTIONS with any other options to pass to the dhcrelay server.
41     # See dhcrelay(8) for available options and syntax.
42     #OPTIONS="-q -i eth0 -i eth1"
43     OPTIONS="-q"
44    
45     # Source dhcrelay configuration. Values specified in this file override
46     # the defaults above.
47     [ -f /etc/sysconfig/dhcrelay ] && . /etc/sysconfig/dhcrelay
48    
49     # Check that at least one DHCP server to relay to was specified.
50     [ "${SERVERS}" = "" ] && exit 0
51    
52     RETVAL=0
53    
54     start() {
55     # Start daemons.
56     echo -n "Starting dhcrelay: "
57     daemon /usr/sbin/dhcrelay $OPTIONS $SERVERS
58     RETVAL=$?
59     echo
60     [ $RETVAL -eq 0 ] && touch /var/lock/subsys/dhcrelay
61     return $RETVAL
62     }
63    
64     stop() {
65     # Stop daemons.
66     echo -n "Shutting down dhcrelay: "
67     killproc dhcrelay
68     RETVAL=$?
69     echo
70     [ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/dhcrelay
71     return $RETVAL
72     }
73    
74     # See how we were called.
75     case "$1" in
76     start)
77     start
78     ;;
79     stop)
80     stop
81     ;;
82     restart|reload)
83     stop
84     start
85     RETVAL=$?
86     ;;
87     condrestart)
88     if [ -f /var/lock/subsys/dhcrelay ]; then
89     stop
90     start
91     RETVAL=$?
92     fi
93     ;;
94     status)
95     status dhcrelay
96     RETVAL=$?
97     ;;
98     *)
99     echo "Usage: dhcrelay {start|stop|restart|condrestart|status}"
100     exit 1
101     esac
102    
103     exit $RETVAL

  ViewVC Help
Powered by ViewVC 1.1.30