Add 'rpi-temp.sh'
This commit is contained in:
parent
a809e504af
commit
2935b248da
23
rpi-temp.sh
Normal file
23
rpi-temp.sh
Normal file
@ -0,0 +1,23 @@
|
||||
#!/bin/bash
|
||||
ALERT=0
|
||||
CORE=1
|
||||
SENSORS=/usr/bin/sensors
|
||||
|
||||
for N in `$SENSORS|grep Core|cut -f 2 -d "+" | cut -f 1 -d "."`
|
||||
do
|
||||
if [ $N -gt "80" ];
|
||||
then
|
||||
echo "ALERT: CPU core $CORE temperature to high, $N degrees Celcius"
|
||||
ALERT=1
|
||||
else
|
||||
echo "OK: CPU core $CORE Temperature $N degrees Celcius"
|
||||
fi
|
||||
CORE=$((CORE+1))
|
||||
done
|
||||
|
||||
if [ $ALERT -eq "1" ];
|
||||
then
|
||||
exit 2
|
||||
else
|
||||
exit 0
|
||||
fi
|
Loading…
x
Reference in New Issue
Block a user