Skip to content

Instantly share code, notes, and snippets.

@mneedham
Forked from benbc/neo4j-wait.sh
Created January 19, 2017 15:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mneedham/b061f8bfc4b92a272d6362d05648dd2b to your computer and use it in GitHub Desktop.
Save mneedham/b061f8bfc4b92a272d6362d05648dd2b 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