Created
October 23, 2021 16:16
-
-
Save terenty-rezman/0b14370492fd18e990947d50ac0f3b9c to your computer and use it in GitHub Desktop.
docker curl wait for db available
This file contains hidden or 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
#!/bin/sh | |
# wait_for_tcp.sh | |
# wait for tcp port to become available | |
# usage | |
# $ ./wait_for_tcp localhost:80 | |
host="$1" | |
until echo -e '\xdclose\x0d' | curl -v telnet://$host/ ; do | |
>&2 echo "${host} is unavailable - sleeping..." | |
sleep 1 | |
done | |
echo "${host} is available" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment