Skip to content

Instantly share code, notes, and snippets.

@suzuki-shunsuke
Created December 1, 2018 09:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save suzuki-shunsuke/a2aa871eb6ce236d9fbbffdf96a6afe1 to your computer and use it in GitHub Desktop.
Save suzuki-shunsuke/a2aa871eb6ce236d9fbbffdf96a6afe1 to your computer and use it in GitHub Desktop.
shell script to check whether broken urls are included in files
s=0
for url in `find ./test -name "*" -type f | xargs xurls | grep -v "ldap.*"`; do
if ! `curl -LI $url -o /dev/null --fail -s`; then
echo $url
s=1
fi
done
if [ $s -ne 0 ]; then
exit 1
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment