[v2,3/4] configurehood: Only provide hood file from GW/KeyXchange via WWW

Submitted by Adrian Schmutzler on June 24, 2018, 9:32 p.m.

Details

Message ID 1529875963-39504-3-git-send-email-freifunk@adrianschmutzler.de
State Superseded
Headers show

Commit Message

Adrian Schmutzler June 24, 2018, 9:32 p.m.
This will copy to hoodfilewww every 5 minutes!

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>

---

Changes in v2:
- Remove additional auth file
- Copy directly after hood file retrieval
---
 src/packages/fff/fff-hoods/files/usr/sbin/configurehood | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

Patch hide | download patch | download mbox

diff --git a/src/packages/fff/fff-hoods/files/usr/sbin/configurehood b/src/packages/fff/fff-hoods/files/usr/sbin/configurehood
index baee487..12046e7 100755
--- a/src/packages/fff/fff-hoods/files/usr/sbin/configurehood
+++ b/src/packages/fff/fff-hoods/files/usr/sbin/configurehood
@@ -77,7 +77,7 @@  if [ -s "$hoodfilelocal" ]; then
 else
 	# if we have Internet, we download the Hoodfile from the keyxchangev2
 	if hasInternet ; then
-		getKeyserverHoodfile "$hoodfiletmp"
+		getKeyserverHoodfile "$hoodfiletmp" && cp "$hoodfiletmp" "$hoodfilewww"
 
 		rm -f "$sectorfiletmp"
 		[ -s "$sectorfilelocal" ] || rm -f "$sectorfilewww" # If internet present, no custom config should be distributed, except when local file is present
@@ -108,7 +108,7 @@  else
 			fi
 		else
 			echo "We have a Gateway in Range, we load the keyxchangev2data from fe80::1"
-			getGatewayHoodfile "$hoodfiletmp"
+			getGatewayHoodfile "$hoodfiletmp" && cp "$hoodfiletmp" "$hoodfilewww"
 			#UPLINK: Do nothing
 		fi
 	fi
@@ -215,7 +215,6 @@  if [ -s "$hoodfiletmp" ]; then
 		# copy the file to webroot so that other mesh routers can download it;
 		# copy only after all other steps so IF can be reentered if something goes wrong
 		cp "$hoodfiletmp" "$hoodfileref"
-		cp "$hoodfiletmp" "$hoodfilewww"
 		[ -s "$sectorfiletmp" ] && cp "$sectorfiletmp" "$sectorfilewww"
 
 		# This is a workaround to enable alfred on devices which do not see a configap during initial setup