Skip to content

Instantly share code, notes, and snippets.

@niallsmart
Created September 23, 2014 19:55
Show Gist options
  • Save niallsmart/7b1a17b2ca76f92d83fe to your computer and use it in GitHub Desktop.
Save niallsmart/7b1a17b2ca76f92d83fe to your computer and use it in GitHub Desktop.
Check URL status
#!/bin/bash
while read url; do
output=`curl -sI "$url" 2>&1 | head -1`
if ! echo $output | grep '200 OK' >/dev/null; then
echo $url
echo $output
fi
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment