From 8a7da6a9a31e5626d43db2b6b5d67ad2b351b1ac Mon Sep 17 00:00:00 2001 From: saunders Date: Wed, 15 Jul 2026 06:06:40 +0100 Subject: [PATCH] Include extra status code The code 000 can be returned by curl e.g. if the provided uri is bad. --- status-check.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/status-check.sh b/status-check.sh index 94a32a5..4cc6e46 100755 --- a/status-check.sh +++ b/status-check.sh @@ -7,7 +7,8 @@ # recipients are sourced from a separate file in the cwd; it is expected to # have a single email address per line. # -# If WATCHDOG_LOG is set, all output will be redirected there. +# If WATCHDOG_LOG is set, all output will be redirected there. It is expected +# to be a writable file. # # Dependencies # - curl: Polling the servers @@ -62,7 +63,7 @@ main() echo "${stat}" # All other HTTP responses should not technically be errors - if ((${stat} >= 400 && ${stat} <= 599)); then + if (((${stat} >= 400 && ${stat} <= 599) || ${stat} == 000)); then FLAGGED[${full_uri}]=${stat} fi done