fff-hoods: Replace hiddenapflag by check for real conditions

Instead of using the hiddenapflag file, we can just check whether
the hood file copy used by the webserver is present. As a second
condition, we check whether the w2configap is not configured yet.

This fixes the following minor issue:
Previously, if configurehood has run once, the hiddenapflag was
set, but the configap not set up yet. If then a restart happens,
the flag is gone (/tmp), but not recreated until a change in the
hood file appears. Thus, no configap would be set up until that
point.
Since we check for a real condition now, this can't be happening.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
Reviewed-by: Tim Niemeyer <tim@tn-x.org>
This commit is contained in:
Adrian Schmutzler 2018-01-05 12:03:59 +01:00 committed by Tim Niemeyer
parent bef333c43b
commit 430049d1b3
1 changed files with 1 additions and 7 deletions

View File

@ -9,7 +9,6 @@
sectorlocal=/etc/sectorfile
sectortmp=/tmp/sectorfile
sectorcopy=/www/hood/sectorfile
hiddenapfile=/tmp/hiddenapflag
resetnetworkfile=/tmp/resetnetwork
hoodlocal=/etc/hoodfile
@ -39,7 +38,7 @@ hasInternet() {
# Hidden AP check
if [ -f "$hiddenapfile" ]; then
if [ -s "$hoodfilecopy" ] && ! uci -q get wireless.w2configap > /dev/null ; then
if isGatewayAvailable ; then
for radio in $(uci show wireless | sed -n 's,.*\.\([a-z0-9]*\)=wifi-device,\1,p'); do
@ -59,8 +58,6 @@ if [ -f "$hiddenapfile" ]; then
uci commit network
wifi
rm "$hiddenapfile"
fi
fi
@ -240,9 +237,6 @@ if [ -s "$hoodfile" ]; then
exit 1
fi
# here we set a bit for add hidden AP
touch "$hiddenapfile"
# add 802.11s mesh if type == "802.11s"
if ( [ -n "$radio5" ] && [ "$mesh_type5" == "802.11s" ] ) || [ "$mesh_type2" == "802.11s" ]; then
if ! wifiAddMesh "$radio" "$mesh_id"; then