new thermal-alert crontab script.

This commit is contained in:
2020-04-16 20:39:10 +00:00
parent 9bba4fa6da
commit 1bf404181e
3 changed files with 19 additions and 1 deletions
+3
View File
@@ -1,5 +1,8 @@
!/bin/bash
# degrees in C
THERMAL_ALERT=75
DISCORD_SERVER_NAME="<YOUR SERVER>"
DISCORD_GENERAL_HOOK="<WEBHOOK_URL_HERE>"
+15
View File
@@ -0,0 +1,15 @@
#!/bin/bash
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`
else
echo "thermal below ${THERMAL_ALERT} C"
source "${LOCATION}/../thermal.sh"
fi
+1 -1
View File
@@ -2,5 +2,5 @@
name=$(</sys/class/thermal/thermal_zone0/type)
temp=$(</sys/class/thermal/thermal_zone0/temp)
echo "${name} $((temp/1000)).$((temp%1000))c"
echo "${name} $((temp/1000)).$((temp%1000)) C"