From: Arne Fitzennreiter Date: Tue, 28 Oct 2008 07:21:12 +0000 (+0100) Subject: Fix collectd initskript not found sysconfig/lm_sensors X-Git-Tag: v2.3-final~28^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=888541fca2c94a0fce12964a7b32407fc4644570;p=ipfire-2.x.git Fix collectd initskript not found sysconfig/lm_sensors at first sensorscan if no sensors are found Change colour of not supported modules to yellow --- diff --git a/src/initscripts/init.d/collectd b/src/initscripts/init.d/collectd index 2593d5d840..801db9a432 100644 --- a/src/initscripts/init.d/collectd +++ b/src/initscripts/init.d/collectd @@ -17,15 +17,16 @@ case "$1" in if [ ! -e /etc/sysconfig/lm_sensors ]; then boot_mesg "Searching for Sensors..." - # First scan + # pre scan and try to load modules "yes" | /usr/sbin/sensors-detect > /dev/null + if [ -e /etc/sysconfig/lm_sensors ]; then + # Module load + for modul in `cat /etc/sysconfig/lm_sensors | grep '^MODULE_' | cut -d"=" -s -f2`; do + modprobe $modul > /dev/null 2>&1; + done + fi - # Module load - for modul in `cat /etc/sysconfig/lm_sensors | grep '^MODULE_' | cut -d"=" -s -f2`; do - modprobe $modul > /dev/null 2>&1; - done - - # Second scan + # Final scan "yes" | /usr/sbin/sensors-detect > /dev/null evaluate_retval @@ -34,13 +35,13 @@ case "$1" in fi fi - boot_mesg -n "Loading Sensor Modules..." + boot_mesg -n "Loading Sensor Modules: " for modul in `cat /etc/sysconfig/lm_sensors | grep '^MODULE_' | cut -d"=" -s -f2`; do modprobe $modul > /dev/null 2>&1; if [ ${?} = 0 ]; then boot_mesg -n "$SUCCESS$modul$NORMAL "; else - boot_mesg -n "$FAILURE$modul$NORMAL "; + boot_mesg -n "$WARNING$modul$NORMAL "; fi done boot_mesg;