Last active
November 29, 2018 00:25
-
-
Save mikepsinn/5556d7dc21a255118e53cd59c2037ef1 to your computer and use it in GitHub Desktop.
Checks a url every 30 seconds and sleeps until 200 response
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
#!/usr/bin/env bash | |
# You can run from a gist using: | |
# curl https://gist.githubusercontent.com/mikepsinn/5556d7dc21a255118e53cd59c2037ef1/raw/50276f283f9ac5e6b5b383ce2089090a6f6d119c/wait_for_200_response.sh | bash -s URL_HERE | |
set -x | |
until $(curl --output /dev/null --silent --head --fail ${1}); do | |
echo "Waiting for ${1}" | |
sleep 30 | |
done | |
echo "200 from ${1}" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment