]> git.pld-linux.org Git - packages/dhcp-helper.git/commitdiff
- initial, init script to run dhcp-helper
authortommat <tommat@pld-linux.org>
Thu, 27 Jul 2006 11:08:22 +0000 (11:08 +0000)
committercvs2git <feedback@pld-linux.org>
Sun, 24 Jun 2012 12:13:13 +0000 (12:13 +0000)
Changed files:
    dhcp-helper.init -> 1.1

dhcp-helper.init [new file with mode: 0644]

diff --git a/dhcp-helper.init b/dhcp-helper.init
new file mode 100644 (file)
index 0000000..7379964
--- /dev/null
@@ -0,0 +1,69 @@
+#!/bin/sh
+# DHCP Server
+#
+# chkconfig:   345 80 20
+# description: DHCP relay helper
+
+# Source function library
+. /etc/rc.d/init.d/functions
+
+# Get network config
+. /etc/sysconfig/network
+
+# Get service config
+[ -f /etc/sysconfig/dhcp-helper ] && . /etc/sysconfig/dhcp-helper
+
+# Check that networking is up.
+if is_yes "${NETWORKING}"; then
+       if [ ! -f /var/lock/subsys/network -a "$1" != stop -a "$1" != status ]; then
+               msg_network_down DHCPD
+               exit 1
+       fi
+else
+       exit 0
+fi
+
+RETVAL=0
+# See how we were called.
+case "$1" in
+  start)
+       # Check if the service is already running?
+       if [ ! -f /var/lock/subsys/dhcp-helper ]; then
+               msg_starting "DHCP helper"
+               
+               [ -n "${RELAY_TO_SERVERS}" ] && DHCPH_OPTIONS="${DHCPH_OPTIONS} -s ${RELAY_TO_SERVERS}"
+               [ -n "${BROADCAST_TO_INTERFACE}" ] && DHCPH_OPTIONS="${DHCPH_OPTIONS} -b ${BROADCAST_TO_INTERFACE}"
+               [ -n "${LISTEN_INTERFACES}" ] && DHCPH_OPTIONS="${DHCPH_OPTIONS} -i ${LISTEN_INTERFACES}"
+               [ -n "${EXCLUDE_INTERFACES}" ] && DHCPH_OPTIONS="${DHCPH_OPTIONS} -e ${EXCLUDE_INTERFACES}"
+                               
+               daemon dhcp-helper ${DHCPH_OPTIONS} 
+               RETVAL=$?
+               [ $RETVAL -eq 0 ] && touch /var/lock/subsys/dhcp-helper
+       else
+               msg_already_running "DHCP helper"
+       fi
+       ;;
+  stop)
+       if [ -f /var/lock/subsys/dhcpd ]; then
+               msg_stopping "DHCP helper"
+               killproc dhcp-helper
+               rm -f /var/run/dhcpd.pid /var/lock/subsys/dhcp-helper >/dev/null 2>&1
+       else
+               msg_not_running "DHCP helper"
+       fi
+       ;;
+  restart|reload)
+       $0 stop
+       $0 start
+       exit $?
+       ;;
+  status)
+       status dhcp-helper
+       exit $?
+       ;;
+  *)
+       msg_usage "$0 {start|stop|restart|force-reload|status}"
+       exit 3
+esac
+
+exit $RETVAL
This page took 0.078061 seconds and 4 git commands to generate.