Perl script that periodically ping a few websites in order to keep a dial-up connection alive
I created this script circa 2004 to help a relative who kept getting disconnected from her dial-up connection because the ISP dropped the connection after 20 minutes of inactivity. This easily happended when, for example, she was composing a long email.
The way this script works is simple: it is invoked periodically and does an HTTP HEAD request on a randomly selected website.
(For those of you who are not old enough to have used a dial-up modem check out the horrible sound it made.)
This script was used on a Windows pc but should work on any platform.
Instructions for installing on Windows:
- Install ActivePerl 5.x
- Put the
dial_up_keep_alive.plscript somewhere on the pc - Create a Windows Scheduled Task that runs the
dial_up_keep_alive.plscript periodically, say every minute
I originally tried to write the script in Java as a daemon-like task. I'de been doing a lot of Java at the time. However, the JVM behaved like this:
- The JVM would start and reported the pc's IP address as 127.0.0.1
- The script would sleep for a while
- The pc established the dial-up connection
- The script woke up but still reported the IP address as 127.0.0.1!
Anyway, running Java on the pc was pretty heavyweight.
A Perl script nicely hit the spot!
MIT. See LICENSE