-
-
Save tevko/fdc5cd88f5d1344b2252 to your computer and use it in GitHub Desktop.
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
#!/bin/bash | |
# usage: | |
# cd Resources | |
# sh check_dead.sh | |
for file in *.md; do | |
echo "====== Reading file: ${file} ======" | |
while read line; do | |
url=$(echo "$line" | sed s/.*\(// | sed s/\)// | sed s/^##.*//) | |
if [[ ! -z "$url" ]]; then | |
echo "- Checking URL: ${url}" | |
curl -s --head "${url}" | head -n 1 | grep "HTTP/1.[01] [^23].." | |
fi | |
done <"$file" | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment