vishnubob / wait-for-it

Pure bash script to test and wait on the availability of a TCP host and port
MIT License
9.39k stars 2.27k forks source link

How to wait for multiple ports to be ready? #99

Closed gkotian closed 4 years ago

gkotian commented 4 years ago

Having quickly skimmed through the script, I couldn't find a way to wait for multiple host+port combinations to be ready. Any pointers on the best way to do this? One way I can imagine is one wait-for-it starting another wait-for-it.

This is probably not a common situation, but in my case I need to wait for two independent databases to get ready before launching my app.

deiga commented 4 years ago

Could wait work for your case?

wait-for-it.sh foo &
wait-for-it.sh bar &
wait-for-it.sh baz &

wait
gkotian commented 4 years ago

That's a good idea. I'll give it a shot.

gkotian commented 4 years ago

I'm sorry that I haven't been able to test this out yet. I will close this issue for now, and reopen if necessary whenever I manage to start looking into this again.