Skip to content

Instantly share code, notes, and snippets.

@sttor
Created July 3, 2022 13:38
Show Gist options
  • Select an option

  • Save sttor/c9f1d2e54d82dac81b6345ce642b5cf2 to your computer and use it in GitHub Desktop.

Select an option

Save sttor/c9f1d2e54d82dac81b6345ce642b5cf2 to your computer and use it in GitHub Desktop.
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