Created
May 5, 2021 17:28
-
-
Save fernandoacorreia/c6a758ef9bb94521984e9da32bfbac57 to your computer and use it in GitHub Desktop.
Wait for HTTP 200 status code
This file contains hidden or 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
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