fff-hoods: Fix fe80::1 for multiple configap interfaces

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
Reviewed-by: Tim Niemeyer <tim@tn-x.org>
This commit is contained in:
Adrian Schmutzler 2017-10-15 16:29:48 +02:00 committed by Tim Niemeyer
parent d788f843b6
commit 3d057de934
1 changed files with 10 additions and 6 deletions

View File

@ -36,17 +36,21 @@ chan5ghz="36"
if [ -f /tmp/hiddenapflag ]; then
if isGatewayAvailable ; then
uci set network.configap=interface
uci set network.configap.proto='static'
uci set network.configap.ip6addr='fe80::1/64'
uci commit network
for radio in $(uci show wireless | sed -n 's,.*\.\([a-z0-9]*\)=wifi-device,\1,p'); do
if ! wifiAddAP "$radio" "config.franken.freifunk.net" "configap" "configap" "1"; then
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