]> git.pld-linux.org Git - packages/lm_sensors.git/commitdiff
- use functions
authorElan Ruusamäe <glen@pld-linux.org>
Wed, 27 Sep 2006 13:40:43 +0000 (13:40 +0000)
committercvs2git <feedback@pld-linux.org>
Sun, 24 Jun 2012 12:13:13 +0000 (12:13 +0000)
Changed files:
    fancontrol.init -> 1.2

fancontrol.init

index cfefcc5381d438c552e57e09c195a0358a0336d0..55be28d4a51295ef9742a1fb927121ca7c501475 100644 (file)
@@ -21,9 +21,7 @@
 # Get service config - may override defaults
 # [ -f /etc/sysconfig/fancontrol ] && . /etc/sysconfig/fancontrol
 
-# See how we were called.
-case "$1" in
-  start)
+start() {
        # Fancontrol needs to check system for pwm control
        if [ ! -f /etc/sysconfig/fancontrol ]; then
                nls "Fancontrol not initialized."
@@ -39,8 +37,9 @@ case "$1" in
        else
                msg_already_running fancontrol
        fi
-       ;;
-  stop)
+}
+
+stop() {
        if [ -f /var/lock/subsys/fancontrol ]; then
                # Stop daemons.
                msg_stopping fancontrol
@@ -49,11 +48,23 @@ case "$1" in
        else
                msg_not_running fancontrol
        fi
+}
+
+restart() {
+       stop
+       start
+}
+
+# See how we were called.
+case "$1" in
+  start)
+       start
+       ;;
+  stop)
+       stop
        ;;
   restart)
-       $0 stop
-       $0 start
-       exit $?
+       restart
        ;;
   reload)
        if [ -f /var/lock/subsys/fancontrol ]; then
@@ -66,13 +77,7 @@ case "$1" in
        fi
        ;;
   force-reload)
-       # if program allows reloading without stopping
-       $0 reload
-
-       # or if it doesn't
-       $0 restart
-
-       exit $?
+       restart
        ;;
   init)
        pwmconfig
This page took 0.038465 seconds and 4 git commands to generate.