Wait Up

Perl, cross-platform

This is a trivial program I just ran off in a few minutes, but it might be useful to others. Imagine the situation: A server is offline, and you are waiting for it to come online. In my case, my web hosting service was down, and I was waiting for it to come back online. As it happens, by the time I finished the program, the server was back up!

The program simply tries to connect via TCP to a given port on a given server, pausing between each try. If it succeeds, it prints out a success message and quits, otherwise it keeps going until it either succeeds or the user kills it.

It’s written in Perl, and also requires the Time::HiRes module from CPAN.

You can do some useful things with it, such as this OS X example

> waitup.pl example.com 80 && say 'The server is back up'

Which will speak to you when the server is ready.


Wait Up—Scans at intervals until a server is up

Copyright (c) Paul Battley / po-ru.com / July 2002

This program comes with ABSOLUTELY NO WARRANTY. This is free software, and you are welcome to redistribute and modify it under the terms of the GNU General Public License (see http://www.fsf.org/licenses/gpl.html for more information).


This program simply repeatedly attempts to connect to a given server on a given port until it either succeeds or is killed.


waitup [options] host[:port]

Port is optional; default value is 80 (HTTP).


--pause N

Number of seconds to wait after each failed attempt before the next.

--timeout N

Timeout in seconds for connection attempts.


View the documentation (this is it!).



  1. Kevin

    Wrote at 2006-07-06 18:47 UTC using Firefox on Windows XP:

    Interesting program, I guess a bash statement such as ‘ping -t hostname:port’ would do the same thing.

    I like your site though. Looks like you have some cool interests.