Skip to content

Instantly share code, notes, and snippets.

@jexp
Forked from benbc/neo4j-wait.sh
Created January 19, 2017 15:01
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save jexp/1e295d5f5b96e8e42fb614232abdbb4f to your computer and use it in GitHub Desktop.
Save jexp/1e295d5f5b96e8e42fb614232abdbb4f to your computer and use it in GitHub Desktop.
Example of using curl to wait for a Neo4j server to be up
#!/bin/bash
end="$((SECONDS+10))"
while true; do
[[ "200" = "$(curl --silent --write-out %{http_code} --output /dev/null http://localhost:7474)" ]] && break
[[ "${SECONDS}" -ge "${end}" ]] && exit 1
sleep 1
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment