From 76297f70c14edfe46d938ab708300008f44a48db Mon Sep 17 00:00:00 2001 From: Christoph Date: Wed, 13 Nov 2019 11:41:29 +0100 Subject: [PATCH] check_remote_websites.sh: if HTTP statuscode is 401, assume the site is online --- check_remote_websites.sh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/check_remote_websites.sh b/check_remote_websites.sh index 236ad60..4437198 100755 --- a/check_remote_websites.sh +++ b/check_remote_websites.sh @@ -204,7 +204,10 @@ if [[ -n "$WEBSITES_TO_CHECK" ]] ; then while [[ $i -lt 3 ]] ; do response="$(curl --max-time $TIME_OUT --connect-timeout 30 \ -I -k -L --write-out %{http_code} --silent --output /dev/null $_site 2> ${LOCK_DIR}/err.msg)" - if [[ "$response" -eq 200 ]]; then + + # 200 - OK + # 401 - Unauthorized (response of roundcube webmailer (since version 1.4) + if [[ "$response" -eq 200 ]] || [[ "$response" -eq 401 ]]; then echo_ok _success=true break