]> git.ipfire.org Git - people/teissler/ipfire-2.x.git/blobdiff - src/initscripts/init.d/collectd
httpscert: Increase size of the RSA key to 4096.
[people/teissler/ipfire-2.x.git] / src / initscripts / init.d / collectd
index a63aea05c828362e79b80c59767e84a2c28e5108..544b3e1f1472af9c4660a91f16b5db041ac6ae27 100644 (file)
@@ -20,6 +20,13 @@ case "$1" in
                        fi
                fi
 
+               # ARM does not support to scan for sensors. In that case,
+               # we create an empty configuration file.
+               machine=$(uname -m)
+               if [ "${machine:0:3}" = "arm" ]; then
+                       touch /etc/sysconfig/lm_sensors
+               fi
+
                # At first run search for sensors with sensors-detect
                if [ ! -e /etc/sysconfig/lm_sensors ]; then
                        boot_mesg "Searching for Sensors..."
@@ -59,7 +66,7 @@ case "$1" in
                fi
 
                # Enable sensors plugin if sensors found
-               if [ $( sensors 2>&1 | grep "No sensors found!" | wc -l ) == "1" ]; then
+               if [ "$( sensors 2>&1 | grep 'No sensors found!' | wc -l )" == "1" ]; then
                        sed -i -e "s|^LoadPlugin sensors|#LoadPlugin sensors|g" /etc/collectd.conf
                else
                        sed -i -e "s|^#LoadPlugin sensors|LoadPlugin sensors|g" /etc/collectd.conf
@@ -79,9 +86,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..."