Skip to content

Instantly share code, notes, and snippets.

@mikepsinn
Last active November 29, 2018 00:25
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 mikepsinn/5556d7dc21a255118e53cd59c2037ef1 to your computer and use it in GitHub Desktop.
Save mikepsinn/5556d7dc21a255118e53cd59c2037ef1 to your computer and use it in GitHub Desktop.
Checks a url every 30 seconds and sleeps until 200 response
#!/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