]> git.pld-linux.org Git - packages/dhcp.git/commitdiff
- use functions
authorElan Ruusamäe <glen@pld-linux.org>
Tue, 26 Sep 2006 19:08:46 +0000 (19:08 +0000)
committercvs2git <feedback@pld-linux.org>
Sun, 24 Jun 2012 12:13:13 +0000 (12:13 +0000)
Changed files:
    dhcp.init -> 1.14

dhcp.init

index c06ae4b348a7aa02a26541577ee10c9b7f82f232..129ba26f8cd3faffb2aee6a744a6d4315aa563eb 100644 (file)
--- a/dhcp.init
+++ b/dhcp.init
@@ -23,10 +23,7 @@ else
        exit 0
 fi
 
-RETVAL=0
-# See how we were called.
-case "$1" in
-  start)
+start() {
        # Check if the service is already running?
        if [ ! -f /var/lock/subsys/dhcpd ]; then
                msg_starting "DHCP Server"
@@ -36,8 +33,9 @@ case "$1" in
        else
                msg_already_running DHCPD
        fi
-       ;;
-  stop)
+}
+
+stop() {
        if [ -f /var/lock/subsys/dhcpd ]; then
                msg_stopping "DHCP Server"
                killproc dhcpd
@@ -45,11 +43,20 @@ case "$1" in
        else
                msg_not_running DHCPD
        fi
+}
+
+RETVAL=0
+# See how we were called.
+case "$1" in
+  start)
+       start
+       ;;
+  stop)
+       stop
        ;;
   restart|reload)
-       $0 stop
-       $0 start
-       exit $?
+       stop
+       start
        ;;
   status)
        status dhcpd
This page took 0.110075 seconds and 4 git commands to generate.