From patchwork Mon Mar 21 23:04:07 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [1/2] Tunnelaufbau erst, wenn Position und Kontakt Adresse gesetzt. From: =?utf-8?q?Christoph_s=C3=BCpke?= X-Patchwork-Id: 32 Message-Id: <1458601448-23088-1-git-send-email-suepke.christoph@gmail.com> To: franken-dev@freifunk.net Cc: Christoph Date: Tue, 22 Mar 2016 00:04:07 +0100 Signed-off-by: Christoph --- bsp/default/root_file_system/etc/fastdstart.sh.tpl | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/bsp/default/root_file_system/etc/fastdstart.sh.tpl b/bsp/default/root_file_system/etc/fastdstart.sh.tpl index 5bb5165..56f5eda 100755 --- a/bsp/default/root_file_system/etc/fastdstart.sh.tpl +++ b/bsp/default/root_file_system/etc/fastdstart.sh.tpl @@ -13,10 +13,20 @@ if [ "$SERVER" = "no" ]; then test -f /tmp/started || exit fi -# Only do something with fastd when the router has internet connection +# Only do something with fastd when the router has internet connection and is configured + +uci get system.@system[0].latitude +lat=$? +uci get system.@system[0].longitude +lon=$? +uci get system.@system[0].contact +mail=$? + + 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 + ping6 -w5 -c3 "$test_ipv6_host1" &>/dev/null || + [ $lat -eq 0 ] && [ $lon -eq 0 ] && [ $mail -eq 0 ]; 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)