- use functions
authorElan Ruusamäe <glen@pld-linux.org>
Sat, 6 Jan 2007 17:19:57 +0000 (17:19 +0000)
committercvs2git <feedback@pld-linux.org>
Sun, 24 Jun 2012 12:13:13 +0000 (12:13 +0000)
Changed files:
    darkice.init -> 1.2

darkice.init

index 823b055..8244e75 100644 (file)
@@ -21,10 +21,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/darkice ]; then
                msg_starting darkice
@@ -36,8 +33,9 @@ case "$1" in
        else
                msg_already_running Darkice
        fi
-       ;;
-  stop)
+}
+
+stop() {
        # Stop daemons.
        if [ -f /var/lock/subsys/darkice ]; then
                msg_stopping darkice
@@ -47,10 +45,20 @@ case "$1" in
        else
                msg_not_running Darkice
        fi
+}
+
+RETVAL=0
+# See how we were called.
+case "$1" in
+  start)
+       start
+       ;;
+  stop)
+       stop
        ;;
   restart)
-       $0 stop
-       $0 start
+       stop
+       start
        ;;
   status)
        status darkice
This page took 0.07017 seconds and 4 git commands to generate.