5 # description: DHCP relay helper
7 # Source function library
8 . /etc/rc.d/init.d/functions
11 . /etc/sysconfig/network
14 [ -f /etc/sysconfig/dhcp-helper ] && . /etc/sysconfig/dhcp-helper
16 # Check that networking is up.
17 if is_yes "${NETWORKING}"; then
18 if [ ! -f /var/lock/subsys/network -a "$1" != stop -a "$1" != status ]; then
19 msg_network_down DHCPD
27 # See how we were called.
30 # Check if the service is already running?
31 if [ ! -f /var/lock/subsys/dhcp-helper ]; then
32 msg_starting "DHCP helper"
34 [ -n "${RELAY_TO_SERVERS}" ] && DHCPH_OPTIONS="${DHCPH_OPTIONS} -s ${RELAY_TO_SERVERS}"
35 [ -n "${BROADCAST_TO_INTERFACE}" ] && DHCPH_OPTIONS="${DHCPH_OPTIONS} -b ${BROADCAST_TO_INTERFACE}"
36 [ -n "${LISTEN_INTERFACES}" ] && DHCPH_OPTIONS="${DHCPH_OPTIONS} -i ${LISTEN_INTERFACES}"
37 [ -n "${EXCLUDE_INTERFACES}" ] && DHCPH_OPTIONS="${DHCPH_OPTIONS} -e ${EXCLUDE_INTERFACES}"
39 daemon dhcp-helper ${DHCPH_OPTIONS}
41 [ $RETVAL -eq 0 ] && touch /var/lock/subsys/dhcp-helper
43 msg_already_running "DHCP helper"
47 if [ -f /var/lock/subsys/dhcpd ]; then
48 msg_stopping "DHCP helper"
50 rm -f /var/run/dhcpd.pid /var/lock/subsys/dhcp-helper >/dev/null 2>&1
52 msg_not_running "DHCP helper"
65 msg_usage "$0 {start|stop|restart|force-reload|status}"