Submitted by: Jonathan Norman Date: 2009-01-18 Initial package: 3.0.3 Upstream Status: Submitted Origin: Cross Linux From Scratch Description: Can now include functions from /etc/rc.d/init.d and prints the [ OK ] message on the correct line. diff -Naur lm_sensors-3.0.3.orig/prog/init/lm_sensors.init lm_sensors-3.0.3/prog/init/lm_sensors.init --- lm_sensors-3.0.3.orig/prog/init/lm_sensors.init 2008-03-26 13:37:12.000000000 +0000 +++ lm_sensors-3.0.3/prog/init/lm_sensors.init 2009-01-18 19:38:36.000000000 +0000 @@ -36,7 +36,14 @@ fi # Source function library. -. /etc/init.d/functions +FUNCTIONS=/etc/init.d/functions + + +if [ ! -f $FUNCTIONS ]; then + FUNCTIONS=/etc/rc.d/init.d/functions +fi + +. $FUNCTIONS RETVAL=0 prog="lm_sensors" @@ -58,8 +65,8 @@ # support for sensors. if ! [ -e /proc/sys/dev/sensors ]; then echo -n "$1 $prog: kernel does not have sensors support" - echo_failure echo + echo_failure exit 5 fi @@ -70,8 +77,8 @@ CONFIG=/etc/sysconfig/lm_sensors if ! [ -r "$CONFIG" ] || ! grep '^MODULE_' $CONFIG >/dev/null 2>&1; then echo -n "$1 $prog: not configured, run sensors-detect" - echo_warning echo + echo_warning exit 6 fi @@ -96,11 +103,11 @@ RETVAL=$? if [ $RETVAL -eq 0 ] && touch /var/lock/subsys/lm_sensors ; then - echo_success echo + echo_ok else - echo_failure echo + echo_failure fi } @@ -123,11 +130,11 @@ RETVAL=$? if [ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/lm_sensors ; then - echo_success echo + echo_ok else - echo_failure echo + echo_failure fi } @@ -141,6 +148,7 @@ restart() { stop + sleep 1 start }