#470 internet testing with several ips

This commit is contained in:
Christian Rotzoll 2019-04-09 22:44:16 +01:00
parent 1932d4afa3
commit de8fe85fc9
2 changed files with 18 additions and 2 deletions

View File

@ -72,8 +72,16 @@ while :
if [ ${setupStep} -eq 0 ]; then
# check for internet connection
# https://en.wikipedia.org/wiki/1.1.1.1
online=$(ping 1.0.0.1 -c 1 -W 2 | grep -c '1 received')
if [ ${online} -eq 0 ]; then
# re-test with other server
online=$(ping 8.8.8.8 -c 1 -W 2 | grep -c '1 received')
fi
if [ ${online} -eq 0 ]; then
# re-test with other server
online=$(ping 208.67.222.222 -c 1 -W 2 | grep -c '1 received')
fi
if [ ${online} -eq 0 ]; then
message="no internet connection"

View File

@ -35,8 +35,16 @@ if [ ${#item} -eq 0 ]; then
item="?"
# check if offline
# https://en.wikipedia.org/wiki/1.1.1.1
online=$(ping 1.0.0.1 -c 1 -W 2 | grep -c '1 received')
if [ ${online} -eq 0 ]; then
# re-test with other server
online=$(ping 8.8.8.8 -c 1 -W 2 | grep -c '1 received')
fi
if [ ${online} -eq 0 ]; then
# re-test with other server
online=$(ping 208.67.222.222 -c 1 -W 2 | grep -c '1 received')
fi
fi
# get total number of blocks