Page MenuHomec4science

check_http.sh
No OneTemporary

File Metadata

Created
Fri, May 17, 21:42

check_http.sh

#!/bin/bash
ROOT=$1
if [ "a$ROOT" == 'a' ]; then
echo -e "USAGE:\n$0 https://c4science.ch"
exit 1
fi
URLS=$(curl --silent $ROOT/sitemap.xml \
| grep -v '0.0\|0.4' \
| sed 's/http/\nhttp/g' \
| grep $ROOT \
| sed 's/\(^http[^ <]*\)\(.*\)/\1/g')
for url in $URLS; do
curl --no-buffer --silent --include $url \
| head -n 1 \
| grep '200 OK' 1> /dev/null \
|| echo $url
done

Event Timeline