+ # Enable sensors plugin if sensors found
+ 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
+ fi
+
+ # Enable thermal plugin if thermal_zone found
+ if [ ! -e /sys/class/thermal/thermal_zone0 ]; then
+ sed -i -e "s|^LoadPlugin thermal|#LoadPlugin thermal|g" /etc/collectd.conf
+ else
+ sed -i -e "s|^#LoadPlugin thermal|LoadPlugin thermal|g" /etc/collectd.conf
+ fi
+
+ # Enable swap plugin if swap found
+ if [ "$(swapon -s | wc -l)" == "1" ]; then
+ sed -i -e "s|^LoadPlugin swap|#LoadPlugin swap|g" /etc/collectd.conf
+ else
+ sed -i -e "s|^#LoadPlugin swap|LoadPlugin swap|g" /etc/collectd.conf
+ fi
+