[PATCH] fff-hoods: Fix case of missing keyxchangev2data

Adrian Schmutzler freifunk at adrianschmutzler.de
So Okt 15 14:09:07 CEST 2017


This fixes a missing /tmp/keyxchangev2data due to gateway
misconfiguration.

Signed-off-by: Adrian Schmutzler <freifunk at adrianschmutzler.de>
---
 src/packages/fff/fff-hoods/files/lib/functions/fff/keyxchange | 7 ++++++-
 src/packages/fff/fff-web/files/www/ssl/cgi-bin/home.html      | 7 ++++++-
 2 files changed, 12 insertions(+), 2 deletions(-)

diff --git a/src/packages/fff/fff-hoods/files/lib/functions/fff/keyxchange b/src/packages/fff/fff-hoods/files/lib/functions/fff/keyxchange
index be27e5a..293d56f 100644
--- a/src/packages/fff/fff-hoods/files/lib/functions/fff/keyxchange
+++ b/src/packages/fff/fff-hoods/files/lib/functions/fff/keyxchange
@@ -5,7 +5,12 @@
 . /usr/share/libubox/jshn.sh
 
 getUpgradePath() {
-	if [ -s /tmp/keyxchangev2data ]; then
+	if [ -s /www/public/keyxchangev2data ]; then
+		json_load "$(cat /www/public/keyxchangev2data)"
+		json_select hood
+		json_get_var upath upgrade_path
+		echo "$upath"
+	elif [ -s /tmp/keyxchangev2data ] ; then
 		json_load "$(cat /tmp/keyxchangev2data)"
 		json_select hood
 		json_get_var upath upgrade_path
diff --git a/src/packages/fff/fff-web/files/www/ssl/cgi-bin/home.html b/src/packages/fff/fff-web/files/www/ssl/cgi-bin/home.html
index 1569c01..1aa41ea 100755
--- a/src/packages/fff/fff-web/files/www/ssl/cgi-bin/home.html
+++ b/src/packages/fff/fff-web/files/www/ssl/cgi-bin/home.html
@@ -49,7 +49,12 @@ fi
 
 # read from keyxchangev2data
 . /usr/share/libubox/jshn.sh
-if [ -s /tmp/keyxchangev2data ] ; then
+if [ -s /www/public/keyxchangev2data ] ; then
+	json_load "$(cat /www/public/keyxchangev2data)"
+	json_select hood
+	json_get_var mesh_type2 mesh_type2
+	json_get_var mesh_type5 mesh_type5
+elif [ -s /tmp/keyxchangev2data ] ; then
 	json_load "$(cat /tmp/keyxchangev2data)"
 	json_select hood
 	json_get_var mesh_type2 mesh_type2
-- 
2.7.4



Mehr Informationen über die Mailingliste franken-dev