Files
event-sourcing-examples/wait-for-services.sh
2016-02-14 21:05:47 -08:00

26 lines
467 B
Bash
Executable File

#! /bin/bash
done=false
host=$1
shift
ports=$*
while [[ "$done" = false ]]; do
for port in $ports; do
curl -q http://${host}:${port}/health >& /dev/null
if [[ "$?" -eq "0" ]]; then
done=true
else
done=false
fi
done
if [[ "$done" = true ]]; then
echo connected
break;
fi
#curl -q http://${1?}:8080/health >& /dev/null && curl -q http://${1?}:8081/health >& /dev/null && curl -q http://${1?}:8082/health >& /dev/null
echo -n .
sleep 1
done