Skip to content

Instantly share code, notes, and snippets.

@nghia4007
Forked from rgl/wait_for_http_json_response.sh
Last active September 24, 2020 13:44
Show Gist options
  • Select an option

  • Save nghia4007/88c8f9ab5692fed91e98a19c3d9762c8 to your computer and use it in GitHub Desktop.

Select an option

Save nghia4007/88c8f9ab5692fed91e98a19c3d9762c8 to your computer and use it in GitHub Desktop.
Wait for an HTTP endpoint to return a given JSON property value with Bash, curl and jq
bash -c 'while [[ "$(curl -s localhost:9000/api/system/status | jq --raw-output ''.status'')" != "UP" ]]; do sleep 5; done'
# also check https://gist.github.com/rgl/f90ff293d56dbb0a1e0f7e7e89a81f42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment