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

ddclient.init

index 62cf756f26b4ff4d80f3dd063dc609a04b0b6db1..a4331bcbba353f519240bc5a1b4556af7e9aea71 100644 (file)
@@ -26,10 +26,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/ddclient ]; then
                msg_starting "Dynamic DNS Client"
@@ -39,8 +36,9 @@ case "$1" in
        else
                msg_already_running "Dynamic DNS Client"
        fi
-       ;;
-  stop)
+}
+
+stop() {
        if [ -f /var/lock/subsys/ddclient ]; then
                msg_stopping "Dynamic DNS Client"
                killproc ddclient
@@ -48,11 +46,20 @@ case "$1" in
        else
                msg_not_running "Dynamic DNS Client"
        fi
+}
+
+RETVAL=0
+# See how we were called.
+case "$1" in
+  start)
+       start
+       ;;
+  stop)
+       stop
        ;;
   restart)
-       $0 stop
-       $0 start
-       exit $?
+       stop
+       start
        ;;
   status)
        status ddclient
This page took 0.09777 seconds and 4 git commands to generate.