Remove trailing pipe from current_alarms

This commit is contained in:
Trey Blancher 2023-09-02 11:03:47 -04:00
parent cf33dc92f3
commit 976370452e

View File

@ -291,7 +291,7 @@ while true; do
for alarm in ${alarms}; do for alarm in ${alarms}; do
integer elapsed=$(( now - ${secs[${alarm}]} )) integer elapsed=$(( now - ${secs[${alarm}]} ))
if is_clear "${alarm}" && (( elapsed >= 300 )); then if is_clear "${alarm}" && (( elapsed >= 300 )); then
current_alarms=$(sed -E "s/${alarm}\|?//" <<< "${current_alarms}") current_alarms=$(sed -E "s/${alarm}\|?//; s/|$//" <<< "${current_alarms}")
unset "notice_sent[${alarm}]" unset "notice_sent[${alarm}]"
unset "secs[${alarm}]" unset "secs[${alarm}]"
fi fi