This is not an attempt to continue discussing whether it is evil to contact Google.com in order to make sure an internet connection is available.
This post is intended to explain why the command urlopen("<name of website>") must not be removed from mintupdate.py.
- Thread Steady Info to Google - hardcoded in Linux Mint ?! in general. Your reply at the end of page 1 in particular.
- Posted mintUpdate fix on Github: Only use ping_domain to check connection, don't rely on pinging google.com …
In your reply you wrote that you could not remember why the initial command
Code: Select all
Well, I can tell you why. And I can tell why the address may be changed using the address got from the mintupdate dialog box (prefs["ping_domain"]), but why the whole code block is needed :
Code: Select all
from urllib import urlopen
url=urlopen("prefs["ping_domain"]") <== what ever the right python code will be to get it there, prefixed with http://
log.writelines("++ Connection to the Internet successful (tried to read http://www.google.com)\n")
Why it is there and why it needs to stay:
- urlopen("<name of website>") can be used no matter whether the user is connected through a DSL router or through a proxy.
- if os.system("ping " + prefs["ping_domain"] + " -c1 -q"): can be used from my home machine connected through a DSL router.
But our company proxy server e.g. will discard ping commands to the internet making the command always fail.
Currently mintupdate succeeds on my office machine, because urlopen("<name of webpage>") will pass the proxy.
With the suggested fix mintupdate will always fail on any machine behind a proxy that drops ping commands.
The proper fix will be to keep the code block, but to make sure it uses "http://" + prefs["ping_domain"]" instead of "http://google.com".