kersing / multitech-installer

Installer for TheThingsNetwork on MultiTech Conduit
MIT License
21 stars 17 forks source link

Fix installer.sh network check #21

Closed markruys closed 4 years ago

markruys commented 4 years ago

The installer.sh script checks whether network is available. This check is broken:

root@mtcdt:~# wget http://www.thethingsnetwork.org/
--2019-07-26 13:11:13--  http://www.thethingsnetwork.org/
Resolving www.thethingsnetwork.org... 168.63.126.95
Connecting to www.thethingsnetwork.org|168.63.126.95|:80... connected.
HTTP request sent, awaiting response... 301 Moved Permanently
Location: https://www.thethingsnetwork.org/ [following]
--2019-07-26 13:11:13--  https://www.thethingsnetwork.org/
Connecting to www.thethingsnetwork.org|168.63.126.95|:443... connected.
HTTP request sent, awaiting response... 502 Bad Gateway
2019-07-26 13:11:13 ERROR 502: Bad Gateway.

If you would add a User-Agent header, the 502 error goes a way, but I don't like to fake this header. A few alternatives are possible, like checking github.com or account.thethingsnetwork.org instead. I propose the latter as it is also used at a later point in the script.

kersing commented 4 years ago

Thanks for the fix, however as the installer needs to be able to access github to pull the package I’ve decided to use GitHub.com to verify the network status,