updated thermal cron scripts to format output better

This commit is contained in:
2025-11-11 12:51:33 -05:00
parent 6ec7af0723
commit 32ab993279
2 changed files with 3 additions and 3 deletions
+2 -2
View File
@@ -22,12 +22,12 @@ alert="$?"
if [[ '0' -ne "${alert}" ]]; then
# if currently in an alert status
alertLevelF=$(echo "scale=1 ; ${alertLevel} * 9 / 5 + 32" | bc -l)
ntfy pub -T red_square -t "Thermal alert on $hostname" thermal "${thermal}" $'\n' "above threshold ${alertLevel} C (${alertLevelF} F)"
echo "${thermal}" $'\n' "above threshold ${alertLevel} C (${alertLevelF} F)" | ntfy pub -T red_square -t "Thermal alert on $hostname" thermal
touch "${HOME}/.thermal.alert"
elif [[ -f "${HOME}/.thermal.alert" ]]; then
# if previously in an alert status
alertLevelF=$(echo "scale=1 ; ${alertLevel} * 9 / 5 + 32" | bc -l)
ntfy pub -T orange_square -t "Thermal alert on $hostname" thermal "${thermal}" $'\n' "previously above threshold ${alertLevel} C (${alertLevelF} F)"
echo "${thermal}" $'\n' "previously above threshold ${alertLevel} C (${alertLevelF} F)" | ntfy pub -T orange_square -t "Thermal alert on $hostname" thermal
rm "${HOME}/.thermal.alert"
fi
+1 -1
View File
@@ -7,6 +7,6 @@ hostname=$(hostname)
thermal=$(${scriptRoot}/thermal.sh)
if [[ -n "$thermal" ]]; then
ntfy pub -T yellow_square -t "Thermal status on $hostname" thermal
echo "$thermal" | ntfy pub -T yellow_square -t "Thermal status on $hostname" thermal
fi