From patchwork Fri Oct 27 18:16:33 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: fff-hoods: Remove gateway-up condition for hidden AP From: Adrian Schmutzler X-Patchwork-Id: 635 Message-Id: <1509128193-4005-1-git-send-email-freifunk@adrianschmutzler.de> To: franken-dev@freifunk.net Date: Fri, 27 Oct 2017 20:16:33 +0200 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" fi