3 ms·
It seems a bit silly for nearly all of the scripts to first ping Google before doing anything. It seems to want to check if internet is available (by GETing Goo
by tokenizerrr 9y ago
It seems a bit silly for nearly all of the scripts to first ping Google before doing anything. It seems to want to check if internet is available (by GETing Google) before doing anything else. It performs this check using nc, however it also depends on either wget, curl or fetch for the actual HTTP requests.
I'd just drop the ping to google entirely. If wget/curl/fetch fail, so be it. No need to introduce additional slowness for the small chance internet isn't working.
- ehsankia 9y agoShouldn't the pattern be: 1. Contact service you want result from 2. If 1 fails, THEN contact Google 3. if 2 fails, internet is down, otherwise, service is down
- urda 9y agoNo, the pattern should be: 1. Run script / snippet 2. If 1 fails, it failed, like any other *nix tool. ... there is zero need to get Google involved.
- skanga 9y agoIn addition, the use of "nc" to ping google is bad. This causes the scripts to break in all places that use an http proxy. You already have wget/curl which honors the HTTP_PROXY environment variable. Just use that ...