]> git.pld-linux.org Git - packages/lm_sensors.git/commitdiff
style fixes
authorElan Ruusamäe <glen@delfi.ee>
Fri, 11 Dec 2015 16:14:11 +0000 (18:14 +0200)
committerElan Ruusamäe <glen@delfi.ee>
Fri, 11 Dec 2015 16:14:11 +0000 (18:14 +0200)
fancontrol.init [changed mode: 0644->0755]
lm_sensors.init [changed mode: 0644->0755]
sensord.init [changed mode: 0644->0755]

old mode 100644 (file)
new mode 100755 (executable)
index e073ed6..adf814c
@@ -10,8 +10,6 @@
 #              damadge could occur. For this, be sure, to run init first
 #              and be sure the configuration is correct.
 #
-# $Id$
-#
 # TODO:
 # - check this, case this is my first 'advanced' init script
 # - maybe add some more stop control, like re-running fancontrol and killing
 start() {
        # sensors deamon needs to be started
        # or at least proper modules loaded (provided by sensorsd deamon)
-       if [ -f /var/lock/subsys/sensord ]; then
-               # Check if the service is already running?
-               if [ ! -f /var/lock/subsys/fancontrol ]; then
-                       # Fancontrol needs to check system for pwm control
-                       if [ ! -f /etc/sysconfig/fancontrol ]; then
-                               nls "Fancontrol not initialized."
-                               nls "Try \`%s init' before start." "$0"
-                               exit 6
-                       fi
-
-                       msg_starting fancontrol
-                       # won't start without an output
-                       daemon --fork 'fancontrol >/dev/null'
-                       RETVAL=$?
-                       [ $RETVAL -eq 0 ] && touch /var/lock/subsys/fancontrol
-               else
-                       msg_already_running fancontrol
-               fi
-       else
+       if [ ! -f /var/lock/subsys/sensord ]; then
                echo "Start sensors daemon first"
-               exit 1
+               RETVAL=1
+               return
+       fi
+
+       # Check if the service is already running?
+       if [ -f /var/lock/subsys/fancontrol ]; then
+               msg_already_running fancontrol
+               return
+       fi
+
+       # Fancontrol needs to check system for pwm control
+       if [ ! -f /etc/sysconfig/fancontrol ]; then
+               nls "Fancontrol not initialized."
+               nls "Try \`%s init' before start." "$0"
+               exit 6
        fi
+
+       msg_starting fancontrol
+       # won't start without an output
+       daemon --fork 'fancontrol >/dev/null'
+       RETVAL=$?
+       [ $RETVAL -eq 0 ] && touch /var/lock/subsys/fancontrol
 }
 
 stop() {
-       if [ -f /var/lock/subsys/fancontrol ]; then
-               # Stop daemons.
-               msg_stopping fancontrol
-               # it's crucial to be sure it ended ok, otherwise we get
-               # the fans set and the computer working without any control
-               # and that could cause MASSIVE damage
-               killproc --waitforname fancontrol --waitfortime 30 fancontrol -TERM
-               rm -f /var/lock/subsys/fancontrol
-       else
+       if [ ! -f /var/lock/subsys/fancontrol ]; then
                msg_not_running fancontrol
+               return
        fi
+
+       # Stop daemons.
+       msg_stopping fancontrol
+       # it's crucial to be sure it ended ok, otherwise we get
+       # the fans set and the computer working without any control
+       # and that could cause MASSIVE damage
+       killproc --waitforname fancontrol --waitfortime 30 fancontrol -TERM
+       rm -f /var/lock/subsys/fancontrol
 }
 
 restart() {
@@ -73,28 +74,25 @@ restart() {
 # See how we were called.
 case "$1" in
   start)
-       start
+       start
        ;;
   stop)
-       stop
+       stop
        ;;
   restart)
-       restart
+       restart
        ;;
   init)
-       pwmconfig
-       exit $?
-       ;;
+       pwmconfig
+       exit $?
+       ;;
   status)
        status fancontrol
        RETVAL=$?
        ;;
   *)
-       msg_usage "$0 {start|stop|restart|status|init}"
+       msg_usage "$0 {start|stop|restart|init|status}"
        exit 3
 esac
 
 exit $RETVAL
-
-# This must be last line !
-# vi:syntax=sh
old mode 100644 (file)
new mode 100755 (executable)
index f4c0e32..396327d
@@ -24,9 +24,11 @@ start() {
                msg_already_running "lm_sensors"
                return
        fi
+
        for module in $BUS_MODULES $HWMON_MODULES ; do
                _modprobe single $module
        done
+
        sensors -s
        touch /var/lock/subsys/lm_sensors
 }
@@ -41,6 +43,7 @@ stop() {
                msg_not_running
                return
        fi
+
        msg_stopping "lm_sensors"
        for module in $HWMON_MODULES $BUS_MODULES ; do
                /sbin/modprobe -r $module >/dev/null 2>&1
old mode 100644 (file)
new mode 100755 (executable)
index 4afd772..641c118
@@ -25,6 +25,7 @@ start() {
                msg_already_running "sensors daemon"
                return
        fi
+
        msg_starting "sensors daemon"
        daemon sensord \
                ${INTERVAL:+-i $INTERVAL} \
@@ -51,10 +52,10 @@ RETVAL=0
 # See how we were called.
 case "$1" in
   start)
-       start
+       start
        ;;
   stop)
-       stop
+       stop
        ;;
   status)
        status sensord
This page took 0.154593 seconds and 4 git commands to generate.