]> git.pld-linux.org Git - packages/lm_sensors.git/commitdiff
- use functions
authorElan Ruusamäe <glen@pld-linux.org>
Wed, 15 Nov 2006 15:59:02 +0000 (15:59 +0000)
committercvs2git <feedback@pld-linux.org>
Sun, 24 Jun 2012 12:13:13 +0000 (12:13 +0000)
Changed files:
    sensors_modules.init -> 1.3

sensors_modules.init

index 4a68dc7edd5984b2f253e8fd2f888d759631cecc..b91eb0aa3370add7c61a2fa1a560b58f553fce80 100644 (file)
@@ -15,10 +15,7 @@ if [ -f /etc/sysconfig/sensors_modules ]; then
        . /etc/sysconfig/sensors_modules
 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/sensors_modules ]; then
                if [ -z "$BUS" ] || [ -z "$CHIP" ]; then
@@ -42,8 +39,9 @@ case "$1" in
        else
                msg_already_running "sensors modules"
        fi
-       ;;
-  stop)
+}
+
+stop() {
        if [ -f /var/lock/subsys/sensors_modules ]; then
                msg_stopping "sensors modules"
 
@@ -59,14 +57,23 @@ case "$1" in
        else
                msg_not_running "sensors modules"
        fi
+}
+
+RETVAL=0
+# See how we were called.
+case "$1" in
+  start)
+       start
+       ;;
+  stop)
+       stop
        ;;
   status)
        sensors
        ;;
   restart|force-reload)
-       $0 stop
-       $0 start
-       exit $?
+       stop
+       start
        ;;
   *)
        msg_usage "$0 {start|stop|restart|force-reload|status}"
This page took 0.091424 seconds and 4 git commands to generate.