Created
October 26, 2015 17:35
-
-
Save bcg/eb13de763e4f574f254f to your computer and use it in GitHub Desktop.
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/bash | |
ENVS=(`env|grep _TCP_ADDR`) | |
for addr_env in "${ENVS[@]}" | |
do | |
address=`echo $addr_env|cut -d \= -f 2` | |
port=`printenv ${addr_env%_ADDR*}_PORT` | |
echo "Waiting on TCP connection to $address:$port" | |
while ! exec 6<>/dev/tcp/${address}/${port}; do | |
sleep 2 | |
done | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment