From patchwork Fri Nov 3 20:04:47 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: fff-hoods: Remove gateway-up condition for hidden AP From: Tim Niemeyer X-Patchwork-Id: 661 Message-Id: <1509739487.2774.83.camel@tn-x.org> To: Adrian Schmutzler , franken-dev@freifunk.net Date: Fri, 03 Nov 2017 21:04:47 +0100 Hi Ich hab hier grad das selbe Problem. Am Freitag, den 27.10.2017, 20:16 +0200 schrieb Adrian Schmutzler: > Since the hidden AP clause is entered only once, there may be a case where > the router has been set up and hiddenapfile created, but the gateway being > temporarily unavailable. In this case, no configap would be set up. > > This can be easily fixed by removing the gateway-available condition. > In fact, removing this has no negative side effects, as if the gateway > would be permanently off, the router would go into wXsta mode and > configap would be destroyed again anyway. > > > Signed-off-by: Adrian Schmutzler > --- >  .../fff/fff-hoods/files/usr/sbin/configurehood     | 35 ++++++++++------------ >  1 file changed, 16 insertions(+), 19 deletions(-) > > diff --git a/src/packages/fff/fff-hoods/files/usr/sbin/configurehood b/src/packages/fff/fff-hoods/files/usr/sbin/configurehood > index 1eadc41..19a498a 100755 > --- a/src/packages/fff/fff-hoods/files/usr/sbin/configurehood > +++ b/src/packages/fff/fff-hoods/files/usr/sbin/configurehood > @@ -38,26 +38,23 @@ hasInternet() { >  # Hidden AP check >   >  if [ -f "$hiddenapfile" ]; then > > - if isGatewayAvailable ; then > - > > - for radio in $(uci show wireless | sed -n 's,.*\.\([a-z0-9]*\)=wifi-device,\1,p'); do > > - channel=$(uci get "wireless.${radio}.channel") > > - iface="configap2" > > - if [ "$channel" -gt "14" ]; then > > - iface="configap5" > > - fi > > - uci set network.${iface}=interface > > - uci set network.${iface}.proto='static' > > - uci set network.${iface}.ip6addr='fe80::1/64' > > - if ! wifiAddAP "$radio" "config.franken.freifunk.net" "$iface" "configap" "1"; then > > - echo "Can't add Config interface on $radio." > > - exit 1 > > - fi > > - done > > - uci commit network > > + for radio in $(uci show wireless | sed -n 's,.*\.\([a-z0-9]*\)=wifi-device,\1,p'); do > > + channel=$(uci get "wireless.${radio}.channel") > > + iface="configap2" > > + if [ "$channel" -gt "14" ]; then > > + iface="configap5" > > + fi > > + uci set network.${iface}=interface > > + uci set network.${iface}.proto='static' > > + uci set network.${iface}.ip6addr='fe80::1/64' > > + if ! wifiAddAP "$radio" "config.franken.freifunk.net" "$iface" "configap" "1"; then > > + echo "Can't add Config interface on $radio." > > + exit 1 > > + fi > > + done > > + uci commit network >   > > - wifi > > - fi > > + wifi >   rm "$hiddenapfile" Ich hätte jetzt aber eigentlich nur das rm mit in das if rein gezogen: Tim >  fi >   > --  > 2.7.4 > diff --git a/src/packages/fff/fff-hoods/files/usr/sbin/configurehood b/src/packages/fff/fff-hoods/files/usr/sbin/configurehood index 1e2831d..b10d210 100755 --- a/src/packages/fff/fff-hoods/files/usr/sbin/configurehood +++ b/src/packages/fff/fff-hoods/files/usr/sbin/configurehood @@ -57,8 +57,9 @@ if [ -f "$hiddenapfile" ]; then                 uci commit network                   wifi + +               rm "$hiddenapfile"         fi -       rm "$hiddenapfile"  fi    lat=$(uci -q get system.@system[0].latitude)