mirror of
https://github.com/lm-sensors/lm-sensors
synced 2025-08-30 22:05:11 +00:00
remove space bug, add green/red output; changes from
David Mathog mathog@caltech.edu git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@1561 7894878c-1315-0410-8ee3-d5d059ff63e0
This commit is contained in:
@@ -39,6 +39,7 @@
|
|||||||
[ -e /var/lock/subsys/sensors ] || /sbin/modprobe -r i2c-proc &>/dev/null
|
[ -e /var/lock/subsys/sensors ] || /sbin/modprobe -r i2c-proc &>/dev/null
|
||||||
|
|
||||||
CONFIG=/etc/sysconfig/lm_sensors
|
CONFIG=/etc/sysconfig/lm_sensors
|
||||||
|
PSENSORS=/usr/local/bin/sensors
|
||||||
|
|
||||||
# Source function library.
|
# Source function library.
|
||||||
. /etc/init.d/functions
|
. /etc/init.d/functions
|
||||||
@@ -49,24 +50,30 @@ start() {
|
|||||||
echo -n $"Starting up sensors: "
|
echo -n $"Starting up sensors: "
|
||||||
test -r "$CONFIG" && . "$CONFIG"
|
test -r "$CONFIG" && . "$CONFIG"
|
||||||
|
|
||||||
modules=`grep \^MODULE_ $CONFIG | wc -l`
|
modules=`grep \^MODULE_ $CONFIG | wc -l | tr -d ' '`
|
||||||
i=0
|
i=0
|
||||||
while [ $i -lt $modules ] ; do
|
while [ $i -lt $modules ] ; do
|
||||||
module=`eval echo '$'MODULE_$i`
|
module=`eval echo '$'MODULE_$i`
|
||||||
|
echo starting module __${module}__
|
||||||
/sbin/modprobe $module &>/dev/null
|
/sbin/modprobe $module &>/dev/null
|
||||||
i=`expr $i + 1`
|
i=`expr $i + 1`
|
||||||
done
|
done
|
||||||
|
|
||||||
RETVAL=$?
|
RETVAL=$?
|
||||||
[ $RETVAL -eq 0 ] && touch /var/lock/subsys/sensors
|
if [ $RETVAL -eq 0 ] && touch /var/lock/subsys/sensors ; then
|
||||||
echo
|
echo_success
|
||||||
|
echo
|
||||||
|
else
|
||||||
|
echo_failure
|
||||||
|
echo
|
||||||
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
stop() {
|
stop() {
|
||||||
echo -n $"Shutting down sensors: "
|
echo -n $"Shutting down sensors: "
|
||||||
test -r "$CONFIG" && . "$CONFIG"
|
test -r "$CONFIG" && . "$CONFIG"
|
||||||
|
|
||||||
modules=`grep \^MODULE_ $CONFIG | wc -l`
|
modules=`grep \^MODULE_ $CONFIG | wc -l | tr -d ' '`
|
||||||
i=`expr $modules`
|
i=`expr $modules`
|
||||||
while [ $i -ge 0 ] ; do
|
while [ $i -ge 0 ] ; do
|
||||||
module=`eval echo '$'MODULE_$i`
|
module=`eval echo '$'MODULE_$i`
|
||||||
@@ -76,12 +83,17 @@ stop() {
|
|||||||
/sbin/modprobe -r i2c-proc &>/dev/null
|
/sbin/modprobe -r i2c-proc &>/dev/null
|
||||||
|
|
||||||
RETVAL=$?
|
RETVAL=$?
|
||||||
[ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/sensors
|
if [ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/sensors ; then
|
||||||
echo
|
echo_success
|
||||||
|
echo
|
||||||
|
else
|
||||||
|
echo_failure
|
||||||
|
echo
|
||||||
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
dostatus() {
|
dostatus() {
|
||||||
/usr/bin/sensors
|
$PSENSORS
|
||||||
RETVAL=$?
|
RETVAL=$?
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user