From eded4e7c01e54dbc8ce3928df3cc2afc9549128b Mon Sep 17 00:00:00 2001 From: "Mark D. Studebaker" Date: Sat, 12 Oct 2002 15:48:21 +0000 Subject: [PATCH] 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 --- prog/init/lm_sensors.init | 26 +++++++++++++++++++------- 1 file changed, 19 insertions(+), 7 deletions(-) diff --git a/prog/init/lm_sensors.init b/prog/init/lm_sensors.init index 564dd853..cac763a1 100755 --- a/prog/init/lm_sensors.init +++ b/prog/init/lm_sensors.init @@ -39,6 +39,7 @@ [ -e /var/lock/subsys/sensors ] || /sbin/modprobe -r i2c-proc &>/dev/null CONFIG=/etc/sysconfig/lm_sensors +PSENSORS=/usr/local/bin/sensors # Source function library. . /etc/init.d/functions @@ -49,24 +50,30 @@ start() { echo -n $"Starting up sensors: " test -r "$CONFIG" && . "$CONFIG" - modules=`grep \^MODULE_ $CONFIG | wc -l` + modules=`grep \^MODULE_ $CONFIG | wc -l | tr -d ' '` i=0 while [ $i -lt $modules ] ; do module=`eval echo '$'MODULE_$i` + echo starting module __${module}__ /sbin/modprobe $module &>/dev/null i=`expr $i + 1` done RETVAL=$? - [ $RETVAL -eq 0 ] && touch /var/lock/subsys/sensors - echo + if [ $RETVAL -eq 0 ] && touch /var/lock/subsys/sensors ; then + echo_success + echo + else + echo_failure + echo + fi } stop() { echo -n $"Shutting down sensors: " test -r "$CONFIG" && . "$CONFIG" - modules=`grep \^MODULE_ $CONFIG | wc -l` + modules=`grep \^MODULE_ $CONFIG | wc -l | tr -d ' '` i=`expr $modules` while [ $i -ge 0 ] ; do module=`eval echo '$'MODULE_$i` @@ -76,12 +83,17 @@ stop() { /sbin/modprobe -r i2c-proc &>/dev/null RETVAL=$? - [ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/sensors - echo + if [ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/sensors ; then + echo_success + echo + else + echo_failure + echo + fi } dostatus() { - /usr/bin/sensors + $PSENSORS RETVAL=$? }