Skip to content

Instantly share code, notes, and snippets.

@blasterpal
Created July 12, 2011 11:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save blasterpal/1077830 to your computer and use it in GitHub Desktop.
Save blasterpal/1077830 to your computer and use it in GitHub Desktop.
Curl HTTP Status code check
#!/bin/bash
#http://beerpla.net/2010/06/10/how-to-display-just-the-http-response-code-in-cli-curl/
if test -z "$1"
then
echo "No URL provided."
exit
fi
while true; do
RESPONSE=`curl -sL -w "%{http_code} \\n" $1 -o /dev/null`
echo `date` " | " ${RESPONSE}
sleep 4
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment