Skip to content

Instantly share code, notes, and snippets.

@lzakharov
Created March 14, 2019 11:32
Show Gist options
  • Select an option

  • Save lzakharov/420cce7478be6a509f226a29794f246d to your computer and use it in GitHub Desktop.

Select an option

Save lzakharov/420cce7478be6a509f226a29794f246d to your computer and use it in GitHub Desktop.
Wait for an HTTP endpoint to return 2xx Success with Bash and curl.
echo 'Waiting for an HTTP endpoint to return 2xx'
until $(curl --output /dev/null --silent --fail $1); do
printf '.'
sleep 5
done
echo 'Success!'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment