Created
July 3, 2022 13:38
-
-
Save sttor/c9f1d2e54d82dac81b6345ce642b5cf2 to your computer and use it in GitHub Desktop.
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
| attempt_counter=0 | |
| max_attempts=20 | |
| echo "Starting .." | |
| isUp() { | |
| curl -s -u admin:admin -f "http://localhost:9000/api/system/info" | |
| } | |
| # Wait for server to be up | |
| PING=`isUp` | |
| while [ -z "$PING" ] | |
| do | |
| echo "Retrying ..." | |
| sleep 5 | |
| PING=`isUp` | |
| maxRetries=$(($attempt_counter+1)) | |
| if [ ${attempt_counter} -eq ${max_attempts} ];then | |
| echo "Max retries reached" | |
| break | |
| fi | |
| done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment