]> git.pld-linux.org Git - packages/ddclient.git/blobdiff - ddclient.init
- tabs in preamble
[packages/ddclient.git] / ddclient.init
index f5677c31d7432ee09320ff05d55f6f6a41151f7a..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
@@ -64,7 +71,7 @@ case "$1" in
                killproc ddclient -HUP
                RETVAL=$?
        else
-               msg_not_running "Dynamic DNS Client" >&2
+               msg_not_running "Dynamic DNS Client"
                exit 7
        fi
        ;;
This page took 0.089508 seconds and 4 git commands to generate.