Skip to content

Instantly share code, notes, and snippets.

View ptitfred's full-sized avatar

Frédéric Menou ptitfred

View GitHub Profile
@ptitfred
ptitfred / wait-tcp.sh
Created February 9, 2012 18:19
Wait for a TCP port to be open
#!/bin/bash
function help {
echo "Usage: wait-for port [timeout]"
echo " port is a TCP port number, or the service name (for instance http, ssh)"
echo " timeout is expressed in seconds"
echo " optional (defaulted to 30)"
echo " if <= 0, no timeout"
exit 1
}