configure all hosts for our ping test in the header ;)

This commit is contained in:
Oliver Voelker 2014-11-10 16:01:48 +01:00 committed by Tim Niemeyer
parent 7778ce70ed
commit 57db955ee5
1 changed files with 7 additions and 6 deletions

View File

@ -5,17 +5,18 @@ SERVER="no"
project="${VPN_PROJECT}"
test_internet_host1="mastersword.de"
test_internet_host2="109.163.229.254"
test_ipv4_host1="mastersword.de"
test_ipv4_host2="109.163.229.254"
test_ipv6_host1="heise.de"
if [ "$SERVER" = "no" ]; then
test -f /tmp/started || exit
fi
#Only do something with fastd when the router has internet connection
if ping -w5 -c3 "$test_internet_host1" &>/dev/null ||
ping -w5 -c3 "$test_internet_host2" &>/dev/null ||
ping6 -w5 -c3 heise.de &>/dev/null; then
# Only do something with fastd when the router has internet connection
if ping -w5 -c3 "$test_ipv4_host1" &>/dev/null ||
ping -w5 -c3 "$test_ipv4_host2" &>/dev/null ||
ping6 -w5 -c3 "$test_ipv6_host1" &>/dev/null; then
mac=$(awk '{ mac=toupper($1); gsub(":", "", mac); print mac }' /sys/class/net/br-mesh/address 2>/dev/null)
if [ "$SERVER" = "no" ]; then
hostname=$(cat /proc/sys/kernel/hostname)