]> git.pld-linux.org Git - packages/dhcp.git/blobdiff - dhcp.init
- release 7 (by relup.sh)
[packages/dhcp.git] / dhcp.init
index 89ee292550981a12029c515b094be36139609fd2..2cb8dc2f5cb4c9342f0231c91e171f2676de6bc8 100644 (file)
--- a/dhcp.init
+++ b/dhcp.init
@@ -16,7 +16,7 @@
 # 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
+               msg_network_down "DHCP Server"
                exit 1
        fi
 else
@@ -24,7 +24,7 @@ else
 fi
 
 checkconfig() {
-       show "Checking %s configuration" DHCPD
+       show "Checking %s configuration" "DHCP Server"
        out=`/usr/sbin/dhcpd -t 2>&1`; rc=$?
        if [ $rc -gt 0 ]; then
                fail
@@ -43,7 +43,7 @@ start() {
                RETVAL=$?
                [ $RETVAL -eq 0 ] && touch /var/lock/subsys/dhcpd
        else
-               msg_already_running DHCPD
+               msg_already_running "DHCP Server"
        fi
 }
 
@@ -53,7 +53,17 @@ stop() {
                killproc dhcpd
                rm -f /var/run/dhcpd.pid /var/lock/subsys/dhcpd >/dev/null 2>&1
        else
-               msg_not_running DHCPD
+               msg_not_running "DHCP Server"
+       fi
+}
+
+condrestart() {
+       if [ -f /var/lock/subsys/dhcpd ]; then
+               stop
+               start
+       else
+               msg_not_running dhcpd
+               RETVAL=$1
        fi
 }
 
@@ -61,26 +71,34 @@ RETVAL=0
 # See how we were called.
 case "$1" in
   start)
-       checkconfig || exit 1
-       start
+       checkconfig || exit 1
+       start
        ;;
   stop)
-       stop
+       stop
        ;;
   restart)
-       checkconfig || exit 1
+       checkconfig || exit 1
        stop
        start
        ;;
+  try-restart)
+       checkconfig || exit 1
+       condrestart 0
+       ;;
+  force-reload)
+       checkconfig || exit 1
+       condrestart 7
+       ;;
   checkconfig)
-       checkconfig
+       checkconfig
        ;;
   status)
        status dhcpd
        exit $?
        ;;
   *)
-       msg_usage "$0 {start|stop|restart|checkconfig|status}"
+       msg_usage "$0 {start|stop|restart|try-restart|force-reload|checkconfig|status}"
        exit 3
 esac
 
This page took 0.047153 seconds and 4 git commands to generate.