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

sensors.init

index 0441a557165d7b25e5eca7354fa93bf3767fe3b3..f86f47fb16ad4b1e81bb301acd6b2ac926863397 100644 (file)
@@ -16,10 +16,7 @@ if [ -f /etc/sysconfig/sensors ]; then
        . /etc/sysconfig/sensors
 fi
 
-RETVAL=0
-# See how we were called.
-case "$1" in
-  start)
+start() {
        if [ ! -f /var/lock/subsys/sensors_modules ]; then
                msg_starting "sensors daemon"; fail
                nls "sensors_modules services not started" >&2
@@ -42,8 +39,9 @@ case "$1" in
        else
                msg_already_running "sensors daemon"
        fi
-       ;;
-  stop)
+}
+
+stop() {
        if [ -f /var/lock/subsys/sensors ]; then
                msg_stopping "sensors daemon"
                killproc sensord
@@ -51,6 +49,16 @@ case "$1" in
        else
                msg_not_running "sensors daemon"
        fi
+}
+
+RETVAL=0
+# See how we were called.
+case "$1" in
+  start)
+       start
+       ;;
+  stop)
+       stop
        ;;
   status)
        status sensors sensord
@@ -58,9 +66,8 @@ case "$1" in
        sensors
        ;;
   restart|force-reload)
-       $0 stop
-       $0 start
-       exit $?
+       stop
+       start
        ;;
   *)
        msg_usage "$0 {start|stop|restart|force-reload|status}"
This page took 0.034351 seconds and 4 git commands to generate.