check_remote_websites.sh: if HTTP statuscode is 401, assume the site is online

This commit is contained in:
Christoph 2019-11-13 11:41:29 +01:00
parent c0959fa621
commit 76297f70c1

View File

@ -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