Skip to content

Instantly share code, notes, and snippets.

@fernandoacorreia
Created May 5, 2021 17:28
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 fernandoacorreia/c6a758ef9bb94521984e9da32bfbac57 to your computer and use it in GitHub Desktop.
Save fernandoacorreia/c6a758ef9bb94521984e9da32bfbac57 to your computer and use it in GitHub Desktop.
Wait for HTTP 200 status code
declare http_code
until [[ $http_code -eq 200 ]]; do
login_url="$HOST/login"
http_code=$(curl -I $login_url -o /dev/null -w '%{http_code}' -s)
if [[ $http_code -ne 200 ]]; then
echo "$login_url returned status code $http_code, sleeping for 10 secs"
sleep 10
fi
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment