Skip to content

Instantly share code, notes, and snippets.

@emilong
Created October 14, 2016 00:17
Show Gist options
  • Save emilong/0d96b0cb8089dbecf526c94fadcc2c60 to your computer and use it in GitHub Desktop.
Save emilong/0d96b0cb8089dbecf526c94fadcc2c60 to your computer and use it in GitHub Desktop.
#!/bin/bash
echo "Waiting for servers to start..."
while true; do
curl -f http://localhost:8000/health > /dev/null 2> /dev/null
if [ $? = 0 ]; then
echo "Frontend started"
curl -f http://localhost:3000/health > /dev/null 2> /dev/null
if [ $? = 0 ]; then
echo "Backend started"
break
fi
fi
sleep 10
echo -n .
done
@NewAlexandria
Copy link

What should be echo'd / returned if a service has failed. E.G. it's has started, but doesn't function correctly (based on 'bad' response, like a null when some endpoint should return data)?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment