Created
February 22, 2018 15:13
-
-
Save tikolakin/3996c99162a6dc9d4ac8627f2511f558 to your computer and use it in GitHub Desktop.
check status code with curl
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 | |
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