thermal scripts updated, crons only poll temp once, etc.
This commit is contained in:
@@ -1,2 +1,3 @@
|
||||
/log/singleton.log
|
||||
/config.sh
|
||||
/crons/*.status
|
||||
|
||||
+12
-6
@@ -4,12 +4,18 @@ LOCATION=`dirname "$0"`
|
||||
|
||||
source "${LOCATION}/../config.sh"
|
||||
|
||||
if (( `cat /sys/class/thermal/thermal_zone0/temp` > ( $THERMAL_ALERT * 1000 ) )); then
|
||||
echo "thermal above ${THERMAL_ALERT} C"
|
||||
source "${LOCATION}/../thermal.sh"
|
||||
${LOCATION}/../discord.sh thermal `${LOCATION}/../thermal.sh`
|
||||
thermal=`${LOCATION}/../thermal.sh ${THERMAL_ALERT}`
|
||||
alert=$?
|
||||
|
||||
if [[ "0" != "${alert}" ]]; then
|
||||
echo "${thermal}, above threshold ${THERMAL_ALERT} C"
|
||||
${LOCATION}/../discord.sh thermal "${thermal}, above threshold ${THERMAL_ALERT} C"
|
||||
touch "${LOCATION}/thermal.status"
|
||||
elif [[ -f "${LOCATION}/thermal.status" ]]; then
|
||||
rm "${LOCATION}/thermal.status"
|
||||
echo "${thermal}, previously above threshold ${THERMAL_ALERT} C"
|
||||
${LOCATION}/../discord.sh thermal "${thermal}, previously above threshold ${THERMAL_ALERT} C"
|
||||
else
|
||||
echo "thermal below ${THERMAL_ALERT} C"
|
||||
source "${LOCATION}/../thermal.sh"
|
||||
echo "${thermal}, below threshold ${THERMAL_ALERT} C"
|
||||
fi
|
||||
|
||||
|
||||
@@ -2,6 +2,8 @@
|
||||
|
||||
LOCATION=`dirname "$0"`
|
||||
|
||||
source "${LOCATION}/../thermal.sh"
|
||||
${LOCATION}/../discord.sh thermal `${LOCATION}/../thermal.sh`
|
||||
thermal=`${LOCATION}/../thermal.sh`
|
||||
|
||||
echo "${thermal}"
|
||||
${LOCATION}/../discord.sh thermal "${thermal}"
|
||||
|
||||
|
||||
+6
-1
@@ -2,5 +2,10 @@
|
||||
|
||||
name=$(</sys/class/thermal/thermal_zone0/type)
|
||||
temp=$(</sys/class/thermal/thermal_zone0/temp)
|
||||
echo "${name}: $((temp/1000)).$((temp%1000)) C"
|
||||
temp="$((temp/1000)).$((temp/100%10))"
|
||||
echo "${name}: ${temp} C"
|
||||
|
||||
if (( "$#" > "0" )); then
|
||||
exit `echo "$temp >= $1" | bc`
|
||||
fi
|
||||
|
||||
|
||||
Reference in New Issue
Block a user