Created
May 3, 2017 21:11
-
-
Save ivanrad/d0739bbbabed4ab9d783f856e853418e to your computer and use it in GitHub Desktop.
waitport
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 | |
host=$1 | |
port=$2 | |
retries=600 | |
for i in `seq $retries`; do | |
nc -z $host $port >/dev/null && exit 0 | |
sleep 0.1 | |
done | |
exit 1 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment