Created
May 24, 2011 21:51
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
# wait for a remote server to start up | |
function wait_for_server() { | |
echo -n "waiting for server to start" | |
for i in {1..10}; | |
do | |
nc "$1" "$2" < /dev/null && echo && return 0; | |
echo -n "." | |
sleep 1 | |
done | |
echo "timed out" | |
return $? | |
} | |
# wait_for_server localhost 8080 && echo "up!" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment