]> git.pld-linux.org Git - packages/tenshi.git/commitdiff
- use functions
authorElan Ruusamäe <glen@pld-linux.org>
Wed, 18 Jul 2007 15:20:46 +0000 (15:20 +0000)
committercvs2git <feedback@pld-linux.org>
Sun, 24 Jun 2012 12:13:13 +0000 (12:13 +0000)
Changed files:
    tenshi.init -> 1.5

tenshi.init

index a069a5f8e02834a9c204e3172d914895b43c8e6e..d550062d5b3a3e0d6d6e2effdd322b75ac7138d9 100644 (file)
@@ -17,10 +17,7 @@ checkconfig() {
        return $?
 }
 
-RETVAL=0
-# See how we were called.
-case "$1" in
-  start)
+start() {
        # Check if the service is already running?
        if [ ! -f /var/lock/subsys/tenshi ]; then
                msg_starting tenshi
@@ -30,20 +27,30 @@ case "$1" in
        else
                msg_already_running tenshi
        fi
-       ;;
-  stop)
-        if [ -f /var/lock/subsys/tenshi ]; then
+}
+
+stop() {
+       if [ -f /var/lock/subsys/tenshi ]; then
                msg_stopping tenshi
                killproc tenshi
                rm -f /var/run/tenshi/tenshi.pid /var/lock/subsys/tenshi >/dev/null 2>&1
        else
                msg_not_running tenshi
        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 tenshi
This page took 0.141834 seconds and 4 git commands to generate.