new thermal-alert crontab script.
This commit is contained in:
@@ -1,5 +1,8 @@
|
||||
!/bin/bash
|
||||
|
||||
# degrees in C
|
||||
THERMAL_ALERT=75
|
||||
|
||||
DISCORD_SERVER_NAME="<YOUR SERVER>"
|
||||
|
||||
DISCORD_GENERAL_HOOK="<WEBHOOK_URL_HERE>"
|
||||
|
||||
Executable
+15
@@ -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
@@ -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"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user