Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

A simple program to help you react more quickly to servers and services coming back online.

branch: master

Fetching latest commit…

Octocat-spinner-32-eaf2f5

Cannot retrieve the latest commit at this time

Octocat-spinner-32 .gitignore
Octocat-spinner-32 README.markdown
Octocat-spinner-32 waitforsocket.go
README.markdown

This is a simple go program that waits for a remote socket to become available. It's useful to avoid guessing when a service comes back up, etc...

Install

Assuming you have a recent go compiler installed and working correctly, you can install waitforsocket with the following command:

go get github.com/dustin/waitforsocket

Example

waitforsocket somehost:22 ; ssh somehost

You can wait for multiple hosts in a similar way:

waitforsocket somehost:22 otherhost:22

If you want to be fancy, you can look for a variety of hosts, and be satisfied when any one of them works (e.g. am I on the internet?):

waitforsocket -required=1 www.{yahoo,google,microsoft}.com:80
Something went wrong with that request. Please try again.