discord alert hook added, made alert crons use it

This commit is contained in:
2025-07-11 09:27:28 -04:00
parent 6180c88fab
commit 254fa04f43
4 changed files with 16 additions and 5 deletions
+1 -1
View File
@@ -40,5 +40,5 @@ else
exit 0
fi
printf "%s\n" "${messages[@]}" | "${scriptRoot}/discord.sh" -c "${color}" -t "${title}"
printf "%s\n" "${messages[@]}" | "${scriptRoot}/discord.sh" -a -c "${color}" -t "${title}"
+2 -2
View File
@@ -21,12 +21,12 @@ alert="$?"
if [[ '0' -ne "${alert}" ]]; then
# if currently in an alert status
alertLevelF=$(echo "scale=1 ; ${alertLevel} * 9 / 5 + 32" | bc -l)
"${scriptRoot}/discord.sh" -c red -t 'Thermal Alert' "${thermal}" $'\n' "above threshold ${alertLevel} C (${alertLevelF} F)"
"${scriptRoot}/discord.sh" -a -c red -t 'Thermal Alert' "${thermal}" $'\n' "above threshold ${alertLevel} C (${alertLevelF} F)"
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)
"${scriptRoot}/discord.sh" -c orange -t 'Thermal Alert' "${thermal}" $'\n' "previously above threshold ${alertLevel} C (${alertLevelF} F)"
"${scriptRoot}/discord.sh" -a -c orange -t 'Thermal Alert' "${thermal}" $'\n' "previously above threshold ${alertLevel} C (${alertLevelF} F)"
rm "${HOME}/.thermal.alert"
fi