diff --git a/crons/thermal-alert.sh b/crons/thermal-alert.sh index 74f9f3a..225ef2e 100755 --- a/crons/thermal-alert.sh +++ b/crons/thermal-alert.sh @@ -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 diff --git a/crons/thermal-log.sh b/crons/thermal-log.sh index 2ac0f44..0500c0c 100755 --- a/crons/thermal-log.sh +++ b/crons/thermal-log.sh @@ -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