]> git.pld-linux.org Git - packages/lm_sensors.git/blobdiff - sensors.init
- pre and post moved to sensord package
[packages/lm_sensors.git] / sensors.init
index e79a7c5206452edd52a4b61179c9ae97649679d4..66207f01db6648cd49f1777d3aa8b5466c39d702 100644 (file)
@@ -22,13 +22,18 @@ case "$1" in
        # Check if the service is already running?
        if [ ! -f /var/lock/subsys/sensors ]; then
                if [ -z "$BUS" ] || [ -z "$CHIP" ]; then 
-                       # sensors not configured                
+                       msg_starting "sensors daemon"; fail
+                       nls "BUS or CHIP not configured in /etc/sysconfig/sensors"
                        exit 1
                fi
                
                # insert modules
-               _modprobe single die "i2c-$BUS"
-               _modprobe single die "$CHIP"
+               for i in $BUS; do
+                       _modprobe single die "i2c-$i"
+               done
+               for i in $CHIP; do
+                       _modprobe single die "$i"
+               done
 
                if [ "$SENSORS_SET" = "1" ]; then
                        sensors -s
@@ -43,7 +48,7 @@ case "$1" in
                RET=$?
                [ $RET -eq 0 ] && touch /var/lock/subsys/sensors
        else
-               msg_Already_Running "sensors daemon"
+               msg_already_running "sensors daemon"
                exit 1
        fi
        touch /var/lock/subsys/sensors
@@ -54,24 +59,29 @@ case "$1" in
                killproc sensord
                
                # remove kernel modules
-               /sbin/rmmod $CHIP >/dev/null 2>&1 
-               /sbin/rmmod i2c-$BUS >/dev/null 2>&1 
+               for i in $CHIP; do
+                       /sbin/rmmod $i >/dev/null 2>&1
+               done
+               for i in $BUS; do
+                       /sbin/rmmod i2c-$BUS >/dev/null 2>&1
+               done
                
                rm -f /var/lock/subsys/sensors
        else
-               msg_Not_Running "sensors daemon"
+               msg_not_running "sensors daemon"
                exit 1
        fi
        ;;
   status)
-       status sensord
+       status sensors sensord
+       sensors
        ;;
   restart)
        $0 stop
        $0 start
        ;;
   *)
-       msg_Usage "$0 {start|stop|status|restart}"
+       msg_usage "$0 {start|stop|status|restart}"
        exit 1
 esac
 
This page took 0.029159 seconds and 4 git commands to generate.