Skip to content

Instantly share code, notes, and snippets.

@tikolakin
Created February 22, 2018 15:13
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 tikolakin/3996c99162a6dc9d4ac8627f2511f558 to your computer and use it in GitHub Desktop.
Save tikolakin/3996c99162a6dc9d4ac8627f2511f558 to your computer and use it in GitHub Desktop.
check status code with curl
#!/bin/bash
while true
do
STATUS=$(curl -s -o /dev/null -w '%{http_code}' http://www.google.com)
if [ $STATUS -eq 200 ]; then
echo "Got 200! All done!"
break
else
echo "Got $STATUS :( Not done yet..."
fi
sleep 10
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment