Skip to content

Instantly share code, notes, and snippets.

@rfletcher
Created May 24, 2011 21:51
Show Gist options
  • Save rfletcher/989821 to your computer and use it in GitHub Desktop.
Save rfletcher/989821 to your computer and use it in GitHub Desktop.
# 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