fff-hoods: Fix case of missing keyxchangev2data

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

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
Reviewed-by: Tim Niemeyer <tim@tn-x.org>
- Added double quote around $jsonfile
Signed-off-by: Tim Niemeyer <tim@tn-x.org>
This commit is contained in:
Adrian Schmutzler 2017-10-15 18:00:33 +02:00 committed by Tim Niemeyer
parent 3d057de934
commit c4ae6bf216
2 changed files with 18 additions and 5 deletions

View File

@ -4,9 +4,21 @@
. /usr/share/libubox/jshn.sh
getJsonPath() {
jsonfile=""
if [ -s /www/public/keyxchangev2data ] ; then
jsonfile="/www/public/keyxchangev2data"
elif [ -s /tmp/keyxchangev2data ] ; then
jsonfile="/tmp/keyxchangev2data"
fi
echo "$jsonfile"
}
getUpgradePath() {
if [ -s /tmp/keyxchangev2data ]; then
json_load "$(cat /tmp/keyxchangev2data)"
jsonfile="$(getJsonPath)"
if [ -n "$jsonfile" ] ; then
json_load "$(cat "$jsonfile")"
json_select hood
json_get_var upath upgrade_path
echo "$upath"

View File

@ -48,9 +48,10 @@ else
fi
# read from keyxchangev2data
. /usr/share/libubox/jshn.sh
if [ -s /tmp/keyxchangev2data ] ; then
json_load "$(cat /tmp/keyxchangev2data)"
. /lib/functions/fff/keyxchange
jsonfile="$(getJsonPath)"
if [ -n "$jsonfile" ] ; then
json_load "$(cat "$jsonfile")"
json_select hood
json_get_var mesh_type2 mesh_type2
json_get_var mesh_type5 mesh_type5