Skip to content

Instantly share code, notes, and snippets.

@ivanrad
Created May 3, 2017 21:11
Show Gist options
  • Save ivanrad/d0739bbbabed4ab9d783f856e853418e to your computer and use it in GitHub Desktop.
Save ivanrad/d0739bbbabed4ab9d783f856e853418e to your computer and use it in GitHub Desktop.
waitport
#!/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