Last active
July 29, 2020 15:02
-
-
Save bitkill/7c9a8542d7da83ef66e067069db1b210 to your computer and use it in GitHub Desktop.
Wait for a service via tcp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
RETRIES=10 | |
while !</dev/tcp/postgres/5432 & [ $RETRIES -eq 0 ]; do | |
echo "Waiting for postgres server, $((RETRIES--)) remaining attempts..."; | |
sleep 1; | |
done; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment