healthd.sh: Decrease the resource consumption by replacing the

external commands with the built-in bash commands. Contributed by
vbooh.
This commit is contained in:
Jean Delvare committed 2015-02-28 09:11:05 +00:00
1 parent 266a45579c
commit 53d852c9b5
2 files changed
+8 -5

No files matched your search

+1
View File
@@ -10,6 +10,7 @@ SVN HEAD
sensors: Add support for temperature min and critical min hysteresis
fancontrol: Deal with moving hwmon attributes
Fix shell error when FCFANS is not set
healthd: Avoid using external commands
sensors-detect: Add detection of ADC128D818
Add detection of AMD family 16h Kabini and Mullins
Add detection of ITE IT8620E and IT8623E
+7 -5
View File
@@ -25,7 +25,8 @@ PATH="/bin:/usr/bin:/usr/local/bin:${PATH}"
ADMIN_EMAIL="root@localhost"
if [ -n "`sensors | grep ALARM`" ]
sensors_state=$(sensors)
if [[ "$sensors_state" =~ 'ALARM' ]]
then
echo "Pending Alarms on start up! Exiting!"
exit
@@ -33,10 +34,11 @@ fi
while true
do
sleep 15
if [ -n "`sensors | grep ALARM`" ]
read -t 15 -N 0
sensors_state=$(sensors)
if [[ "$sensors_state" =~ 'ALARM' ]]
then
sensors | mail -s "**** Hardware Health Warning ****" $ADMIN_EMAIL
sleep 600
echo "$sensors_state" | mail -s '**** Hardware Health Warning ****' $ADMIN_EMAIL
read -t 600 -N 0
fi
done