5 # description: DHCP relay agent
7 # Source function library.
8 . /etc/rc.d/init.d/functions
10 # Source networking configuration.
11 . /etc/sysconfig/network
13 # Demon specified configuration.
15 . /etc/sysconfig/dhcp-relay
17 # Check that networking is up.
18 if is_yes "${NETWORKING}"; then
19 if [ ! -f /var/lock/subsys/network -a "$1" != stop -a "$1" != status ]; then
20 msg_network_down "DHCP realay"
27 if [ -n "DHCP_RELAY_INTERFACES" ]; then
28 for iface in $DHCP_RELAY_INTERFACES ; do
29 OPTIONS="$OPTIONS -i $iface"
34 if [ ! -f /var/lock/subsys/dhcp-relay ]; then
35 msg_starting "DHCP relay"
36 daemon /sbin/dhcrelay $OPTIONS $DHCP_SERVERS_IP
38 [ $RETVAL -eq 0 ] && touch /var/lock/subsys/dhcp-relay
40 msg_already_running "DHCP relay"
45 if [ -f /var/lock/subsys/dhcp-relay ]; then
46 msg_stopping "DHCP relay"
48 rm -f /var/lock/subsys/dhcp-relay
50 msg_not_running "DHCP relay"
55 if [ -f /var/lock/subsys/dhcp-relay ]; then
59 msg_not_running "DHCP relay"
65 # See how we were called.
88 msg_usage "$0 {start|stop|restart|try-restart|force-reload|status}"