Skip to content

Instantly share code, notes, and snippets.

@brianpursley
Last active May 25, 2021 16:47
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 brianpursley/229291b6f9aadd78e6120275b57fec87 to your computer and use it in GitHub Desktop.
Save brianpursley/229291b6f9aadd78e6120275b57fec87 to your computer and use it in GitHub Desktop.
Test all kubernetes.io links found in source code to determine which ones are broken
grep -orihEI "(https?:\/\/kubernetes.io/[-a-zA-Z0-9@:%._\+~#=>?/]*[-a-zA-Z0-9@:%_\+~#=>?])" * | sort | uniq -u | xargs -I % bash -c 'if wget --spider % 2>/dev/null; then echo "[OK] %"; else echo "[MISSING] %"; fi' > /tmp/output.txt
cat /tmp/output.txt | grep "\[MISSING\]" | cut -d " " -f2 | xargs -I % grep -riI %
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment