]> git.pld-linux.org Git - packages/apinger.git/commitdiff
- use functions
authorPaweł Gołaszewski <blues@pld-linux.org>
Thu, 2 Aug 2007 11:58:22 +0000 (11:58 +0000)
committercvs2git <feedback@pld-linux.org>
Sun, 24 Jun 2012 12:13:13 +0000 (12:13 +0000)
Changed files:
    apinger.init -> 1.10

apinger.init

index e9da2e8dc42a4521b854d67b815a054e2b0b8c13..0cd501abeb35145f653daed76cc52dd8a3710151 100644 (file)
 # Get service config
 [ -f /etc/sysconfig/apinger ] && . /etc/sysconfig/apinger
 
-RETVAL=0
-# See how we were called.
-case "$1" in
-  start)
-       # Check if the service is already running?
+start() {
        if [ ! -f /var/lock/subsys/apinger ]; then
                msg_starting "Alarm Pinger"
                daemon apinger
@@ -28,9 +24,9 @@ case "$1" in
        else
                msg_already_running "Alarm Pinger"
        fi
-       ;;
-  stop)
-       # Stop daemons.
+}
+
+stop() {
        if [ -f /var/lock/subsys/apinger ]; then
                msg_stopping "Alarm Pinger"
                killproc apinger
@@ -38,6 +34,15 @@ case "$1" in
        else
                msg_not_running "Alarm Pinger"
        fi
+}
+
+RETVAL=0
+# See how we were called.
+case "$1" in
+  start)
+       start
+       ;;
+  stop)
        ;;
   status)
        status apinger
@@ -54,8 +59,8 @@ case "$1" in
        fi
        ;;
   restart)
-       $0 stop
-       $0 start
+       stop
+       start
        exit $?
        ;;
   *)
This page took 0.074125 seconds and 4 git commands to generate.