url check script

This commit is contained in:
Paolo Asperti 2023-12-02 23:54:50 +01:00
parent 6823069961
commit 32e7fa7a70
Signed by: paspo
GPG Key ID: 06D46905D19D5182

20
urls/check_urls.sh Executable file
View File

@ -0,0 +1,20 @@
#!/bin/sh
URLLISTFILE=old_website_urls.txt
if [ "a$1" = "a" ] ; then
echo "Usage:"
echo " $0 [base_url]"
exit 1
fi
if [ ! -r "${URLLISTFILE}" ] ; then
echo "URL list file (${URLLISTFILE}) not readable"
exit 1
fi
while read URL; do
if [ -n "${URL}" ]; then
curl -sL -o /dev/null -w "%{http_code} - %{url_effective}\n" "${1}/${URL}"
fi
done < "${URLLISTFILE}"