periodicFetch

This little shell script fetches a website periodically. If a given interface shuts down then the script exits automatically (at least after a whole period).

You can download the script here. When calling the script with incomplete parameters you get:

periodicFetch.sh
usage: /usr/local/bin/periodicFetch.sh <if> <period> <url>

This is especially useful if your provider kicks a internet connection after the line has been idle for a specific amount of time. Unfortunately, often a running IRC client is “almost” idle for some time. Same holds for mail clients and so on. For this special purpose you may want to add the following file:

cat /etc/ppp/ip-up.d/90-periodicFetch.sh
#!/bin/sh
/usr/local/bin/periodicFetch.sh $1 600 www.yahoo.com 2> /dev/null < /dev/null &