]> git.ipfire.org Git - people/teissler/ipfire-2.x.git/blobdiff - src/initscripts/init.d/collectd
core76: Sort exclude file alphabetically.
[people/teissler/ipfire-2.x.git] / src / initscripts / init.d / collectd
index bdb5ca2f0bcebf0dd095717dca65b24a47566627..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 ";
@@ -86,9 +90,14 @@ case "$1" in
                        sed -i -e "s|^#LoadPlugin swap|LoadPlugin swap|g" /etc/collectd.conf
                fi
 
-               boot_mesg "Starting Collection daemon..."
-               /usr/sbin/collectd -C /etc/collectd.conf
-               evaluate_retval
+               if [ $(date +%Y) -gt 2011 ]; then
+                       boot_mesg "Starting Collection daemon..."
+                       /usr/sbin/collectd -C /etc/collectd.conf
+                       evaluate_retval
+               else
+                       boot_mesg "collectd: cannot start with incorrect time ($(date))."
+                       echo_warning;
+               fi
                ;;
        stop)
                boot_mesg "Stopping Collection daemon..."