collectd initskript: parse new lm_sensors config.
authorArne Fitzenreiter <arne_f@ipfire.org>
Thu, 19 Dec 2013 21:46:48 +0000 (22:46 +0100)
committerArne Fitzenreiter <arne_f@ipfire.org>
Thu, 19 Dec 2013 21:46:48 +0000 (22:46 +0100)
src/initscripts/init.d/collectd

index 544b3e1f1472af9c4660a91f16b5db041ac6ae27..7de005eb41dd56e37be8e9491ce9474b9f9a7fc7 100644 (file)
@@ -34,8 +34,10 @@ case "$1" in
                        # 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
+                               . /etc/sysconfig/lm_sensors
+                               for modul in $BUS_MODULES $HWMON_MODULES ; do
                                        modprobe $modul > /dev/null 2>&1;
                                done
                        fi
@@ -52,8 +54,10 @@ case "$1" in
                # Load sensor modules only first start
                if [ ! -e /var/lock/sensors_modules ]; then
                        touch /var/lock/sensors_modules
+
                        boot_mesg -n "Loading Sensor Modules: "
-                       for modul in `cat /etc/sysconfig/lm_sensors | grep '^MODULE_' | cut -d"=" -s -f2`; do
+                       . /etc/sysconfig/lm_sensors
+                       for modul in $BUS_MODULES $HWMON_MODULES ; do
                        modprobe $modul > /dev/null 2>&1;
                                if [ ${?} = 0 ]; then
                                        boot_mesg -n "$SUCCESS$modul$NORMAL ";