From 177622320e4ffdd4b844d125561521fe4872e98c Mon Sep 17 00:00:00 2001
From: Eike B <derbaranator@gmail.com>
Date: Sun, 26 Apr 2015 21:30:27 +0200
Subject: [PATCH] made netmon-ip for geo-sync dynamic

---
 .../files/lib/ffnw/configurator/configurator.sh    | 14 ++++++--------
 1 file changed, 6 insertions(+), 8 deletions(-)

diff --git a/configurator/files/lib/ffnw/configurator/configurator.sh b/configurator/files/lib/ffnw/configurator/configurator.sh
index 61fc955..a576d4b 100644
--- a/configurator/files/lib/ffnw/configurator/configurator.sh
+++ b/configurator/files/lib/ffnw/configurator/configurator.sh
@@ -154,7 +154,7 @@ autoadd_ipv6_address() {
 sync_geo_location(){
 	if [[ $(awk 'BEGIN{srand();print int(rand()*100)}') -lt 5 ]];then
 		mac=$(uci get wireless.mesh_radio0.macaddr)
-		coords="$(wget -q -O - "http://[fd74:fdaa:9dc4::1]/getcoords.php?mac=$mac")"
+		coords="$(wget -q -O - "http://[${API_IPV6_ADRESS}]/getcoords.php?mac=$mac")"
 		echo "$coords" | grep "[0-9]\{1,3\}\(\.[0-9]\)* [0-9]\{1,3\}\(\.[0-9]\)*"
 		if [ "$?" = "0" ]; then 
 			lat="$(echo "$coords" | cut -d' ' -f1)"
@@ -168,6 +168,10 @@ sync_geo_location(){
 	fi
 }
 
+if [[ $SCRIPT_LOCATION_SET = "0" ]]; then
+	sync_geo_location
+fi
+
 if [ $CRAWL_METHOD == "login" ]; then
 	err "Authentification method is: username and passwort"
 elif [ $CRAWL_METHOD == "hash" ]; then
@@ -188,10 +192,4 @@ fi
 
 if [[ $SCRIPT_SYNC_HOSTNAME = "1" ]]; then
 	sync_hostname
-fi
-
-
-if [[ $SCRIPT_LOCATION_SET = "0" ]]; then
-	sync_geo_location
-fi
-
+fi
\ No newline at end of file
-- 
GitLab