I'm trying to determine if the link is up and running before I try and retrieve something. The idea is that the script spends most of its time asleep and wakes up every x minutes. If it can see a connection it goes and gets something (actually some weather data from a local airport) otherwise it sleeps again.