Last active
December 1, 2018 09:30
-
-
Save suzuki-shunsuke/29ef246fd666cb89b2b78c1a73b01380 to your computer and use it in GitHub Desktop.
shell script to check whether broken urls are included in files
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# xurls: https://github.com/mvdan/xurls | |
s=0 | |
for url in `find . -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