[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Applet to find internet status



On Fri, 20 Mar 2020 22:18:26 +0000
Bhasker C V <bhasker@unixindia.com> wrote:

> But we could use an external IP to communicate ... like 1.1.1.1 or
> curl to some known website to confirm that internet works (which will
> include the system proxy settings).

I did that some years ago, when I had a slightly dubious router which
occasionally needed rebooting. It's not quite as simple as that. I've
seen the router in a state where it would return data from some
websites and not others, and garbled data, when it would pass pings
(which I tried first, of course) but not HTML, and other odd conditions.

I ended up with curl reading six websites, actually returning text and
checking it for accuracy, if one failed then try the next and so on. If
all six were down, reboot. Sometimes quite well-known sites do go down
for a short time, and sometimes they change their text, though I tried
to pick pages that were unlikely to change. There was a read every five
minutes, and I rotated the order of sites so that when all was well,
they would only be read twice an hour, to try and avoid getting
blacklisted anywhere. 

I got to that stage after some weeks, and it seemed quite robust for
a couple of years.

-- 
Joe


Reply to: