From 2299b092ad2c0f6c54cf640fdb7dc7410b5d5aef Mon Sep 17 00:00:00 2001 From: Michael Boelen Date: Mon, 3 Jul 2023 16:11:58 +0200 Subject: [PATCH] Negeer HTTP 302 --- scripts/check-all-links.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/scripts/check-all-links.sh b/scripts/check-all-links.sh index 83ab005..a46853e 100755 --- a/scripts/check-all-links.sh +++ b/scripts/check-all-links.sh @@ -26,7 +26,9 @@ if [ -d ./public ]; then if [ -f ./check-all-links.tmp ]; then for URL in $(cat ./check-all-links.tmp); do HTTP_CODE=$(curl -s -o /dev/null -w "%{http_code}" "${URL}") - if [ ! "${HTTP_CODE}" = "200" ]; then + # 200 = OK + # 302 = Tijdelijke redirect, bijvoorbeeld als authenticatie nodig is (GitHub) + if [ ! "${HTTP_CODE}" = "200" -a ! "${HTTP_CODE}" = "302" ]; then echo "[WARNING] ${URL} (HTTP: ${HTTP_CODE})" fi sleep 2