diff --git a/config.example.sh b/config.example.sh index 23f5ecf..741f27d 100644 --- a/config.example.sh +++ b/config.example.sh @@ -1,5 +1,8 @@ !/bin/bash +# degrees in C +THERMAL_ALERT=75 + DISCORD_SERVER_NAME="" DISCORD_GENERAL_HOOK="" diff --git a/crons/thermal-alert.sh b/crons/thermal-alert.sh new file mode 100755 index 0000000..d626689 --- /dev/null +++ b/crons/thermal-alert.sh @@ -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 + diff --git a/thermal.sh b/thermal.sh index f71e188..5236be7 100755 --- a/thermal.sh +++ b/thermal.sh @@ -2,5 +2,5 @@ name=$(