8
0
Fork 0

Negeer HTTP 302

This commit is contained in:
Michael Boelen 2023-07-03 16:11:58 +02:00
parent 0a6dbe5df3
commit 2299b092ad

View file

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