[PATCH] fff-hoods: Remove gateway-up condition for hidden AP

Tim Niemeyer tim at tn-x.org
Fr Nov 3 21:04:47 CET 2017


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 <freifunk at adrianschmutzler.de>
> ---
>  .../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:


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. at system[0].latitude)


Tim


>  fi
>  
> -- 
> 2.7.4
> 
-------------- nächster Teil --------------
Ein Dateianhang mit Binärdaten wurde abgetrennt...
Dateiname   : signature.asc
Dateityp    : application/pgp-signature
Dateigröße  : 488 bytes
Beschreibung: This is a digitally signed message part
URL         : <http://lists.freifunk.net/pipermail/franken-dev-freifunk.net/attachments/20171103/6c07f71b/attachment.sig>


Mehr Informationen über die Mailingliste franken-dev