fff-hoods: Remove hardcoded IPv4 address and foreign domain
IPv4 is not a requirement for VPN nodes. However, a working DNS is a requirement for nodes connecting via VPN. Therefore the hardcoded IPv4 address is removed from the internet test. To improve readability, a loop is used instead of having a seperate ping command for each host. The ping utility built into our firmware supports both IPv4 and IPv6. Signed-off-by: Fabian Bläse <fabian@blaese.de> Reviewed-by: Robert Langhammer <rlanghammer@web.de> Reviewed-by: Adrian Schmutzler <freifunk@adrianschmutzler.de> [bump PKG_RELEASE] Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
This commit is contained in:
parent
225116dfd2
commit
5cd46fb17b
|
@ -1,7 +1,7 @@
|
||||||
include $(TOPDIR)/rules.mk
|
include $(TOPDIR)/rules.mk
|
||||||
|
|
||||||
PKG_NAME:=fff-hoods
|
PKG_NAME:=fff-hoods
|
||||||
PKG_RELEASE:=10
|
PKG_RELEASE:=11
|
||||||
|
|
||||||
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)
|
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)
|
||||||
|
|
||||||
|
|
|
@ -31,14 +31,10 @@ isGatewayAvailable() {
|
||||||
|
|
||||||
# Ping test
|
# Ping test
|
||||||
hasInternet() {
|
hasInternet() {
|
||||||
test_ipv4_host1="keyserver.freifunk-franken.de" # Freifunk-Franken keyserver
|
internetAddresses="keyserver.freifunk-franken.de heise.de"
|
||||||
test_ipv4_host2="8.8.8.8" # Google DNS
|
for addr in $internetAddresses; do
|
||||||
test_ipv6_host1="heise.de" # heise Zeitschriftenverlag
|
ping -w5 -c3 "$addr" &>/dev/null && return 0
|
||||||
if ping -w5 -c3 "$test_ipv4_host1" &>/dev/null ||
|
done
|
||||||
ping -w5 -c3 "$test_ipv4_host2" &>/dev/null ||
|
|
||||||
ping6 -w5 -c3 "$test_ipv6_host1" &>/dev/null ; then
|
|
||||||
return 0
|
|
||||||
fi
|
|
||||||
return 1
|
return 1
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user