|
|
|
@ -79,29 +79,19 @@ add_wifi_mesh() {
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
if [ "$encryption" != 1 ]; then
|
|
|
|
|
if [ "$mesh_apRadio" == "radio0" ]; then
|
|
|
|
|
apnum="0"
|
|
|
|
|
elif [ "$mesh_apRadio" == "radio1" ]; then
|
|
|
|
|
apnum="1"
|
|
|
|
|
elif [ "$mesh_apRadio" == "radio2" ]; then
|
|
|
|
|
apnum="2"
|
|
|
|
|
elif [ "$mesh_apRadio" == "radio3" ]; then
|
|
|
|
|
apnum="3"
|
|
|
|
|
elif [ "$mesh_apRadio" == "radio4" ]; then
|
|
|
|
|
apnum="4"
|
|
|
|
|
elif [ "$mesh_apRadio" == "radio5" ]; then
|
|
|
|
|
apnum="5"
|
|
|
|
|
elif [ "$mesh_apRadio" == "radio6" ]; then
|
|
|
|
|
apnum="6"
|
|
|
|
|
elif [ "$mesh_apRadio" == "radio7" ]; then
|
|
|
|
|
apnum="7"
|
|
|
|
|
elif [ "$mesh_apRadio" == "radio8" ]; then
|
|
|
|
|
apnum="8"
|
|
|
|
|
elif [ "$mesh_apRadio" == "radio9" ]; then
|
|
|
|
|
apnum="9"
|
|
|
|
|
elif [ "$mesh_apRadio" == "radio10" ]; then
|
|
|
|
|
apnum="10"
|
|
|
|
|
apnum="${mesh_apRadio#radio}"
|
|
|
|
|
apnum=$((apnum + 1))
|
|
|
|
|
|
|
|
|
|
# Check all existing wifinetX and remove if SSID matches with $mesh_id
|
|
|
|
|
while uci get wireless.wifinet$apnum > /dev/null 2>&1; do
|
|
|
|
|
existing_ssid=$(uci get wireless.wifinet$apnum.ssid 2> /dev/null)
|
|
|
|
|
if [ "$existing_ssid" = "$mesh_id" ]; then
|
|
|
|
|
uci delete wireless.wifinet$apnum
|
|
|
|
|
fi
|
|
|
|
|
apnum=$((apnum + 1))
|
|
|
|
|
done
|
|
|
|
|
uci commit wireless
|
|
|
|
|
|
|
|
|
|
uci set wireless.mesh_$apall.encryption='none'
|
|
|
|
|
uci set wireless.wifinet$apnum=wifi-iface
|
|
|
|
|
uci set wireless.wifinet$apnum.device=$mesh_apRadio
|
|
|
|
@ -114,32 +104,21 @@ fi
|
|
|
|
|
uci set wireless.wifinet$apnum.ft_over_ds='0'
|
|
|
|
|
uci set wireless.wifinet$apnum.ft_psk_generate_local='1'
|
|
|
|
|
uci set wireless.wifinet$apnum.network='lan'
|
|
|
|
|
#uci delete wireless.$mesh_apRadio.disabled
|
|
|
|
|
uci commit wireless
|
|
|
|
|
else
|
|
|
|
|
if [ "$mesh_apRadio" == "radio0" ]; then
|
|
|
|
|
apnum="0"
|
|
|
|
|
elif [ "$mesh_apRadio" == "radio1" ]; then
|
|
|
|
|
apnum="1"
|
|
|
|
|
elif [ "$mesh_apRadio" == "radio2" ]; then
|
|
|
|
|
apnum="2"
|
|
|
|
|
elif [ "$mesh_apRadio" == "radio3" ]; then
|
|
|
|
|
apnum="3"
|
|
|
|
|
elif [ "$mesh_apRadio" == "radio4" ]; then
|
|
|
|
|
apnum="4"
|
|
|
|
|
elif [ "$mesh_apRadio" == "radio5" ]; then
|
|
|
|
|
apnum="5"
|
|
|
|
|
elif [ "$mesh_apRadio" == "radio6" ]; then
|
|
|
|
|
apnum="6"
|
|
|
|
|
elif [ "$mesh_apRadio" == "radio7" ]; then
|
|
|
|
|
apnum="7"
|
|
|
|
|
elif [ "$mesh_apRadio" == "radio8" ]; then
|
|
|
|
|
apnum="8"
|
|
|
|
|
elif [ "$mesh_apRadio" == "radio9" ]; then
|
|
|
|
|
apnum="9"
|
|
|
|
|
elif [ "$mesh_apRadio" == "radio10" ]; then
|
|
|
|
|
apnum="10"
|
|
|
|
|
apnum="${mesh_apRadio#radio}"
|
|
|
|
|
apnum=$((apnum + 1))
|
|
|
|
|
|
|
|
|
|
# Check all existing wifinetX and remove if SSID matches with $mesh_id
|
|
|
|
|
while uci get wireless.wifinet$apnum > /dev/null 2>&1; do
|
|
|
|
|
existing_ssid=$(uci get wireless.wifinet$apnum.ssid 2> /dev/null)
|
|
|
|
|
if [ "$existing_ssid" = "$mesh_id" ]; then
|
|
|
|
|
uci delete wireless.wifinet$apnum
|
|
|
|
|
fi
|
|
|
|
|
apnum=$((apnum + 1))
|
|
|
|
|
done
|
|
|
|
|
uci commit wireless
|
|
|
|
|
|
|
|
|
|
uci set wireless.mesh_$apall.encryption='sae'
|
|
|
|
|
uci set wireless.mesh_$apall.key=$key
|
|
|
|
|
uci set wireless.wifinet$apnum=wifi-iface
|
|
|
|
@ -153,9 +132,9 @@ fi
|
|
|
|
|
uci set wireless.wifinet$apnum.ft_over_ds='0'
|
|
|
|
|
uci set wireless.wifinet$apnum.ft_psk_generate_local='1'
|
|
|
|
|
uci set wireless.wifinet$apnum.network='lan'
|
|
|
|
|
#uci delete wireless.$mesh_apRadio.disabled
|
|
|
|
|
uci commit wireless
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
add_kvr() {
|
|
|
|
@ -271,8 +250,6 @@ done
|
|
|
|
|
|
|
|
|
|
echo switching the lan interface to DHCP client
|
|
|
|
|
uci set network.lan.proto='dhcp'
|
|
|
|
|
uci set network.lan.gateway='$ip4addr'
|
|
|
|
|
uci set network.lan.dns='$ip4addr'
|
|
|
|
|
uci delete network.wan
|
|
|
|
|
uci delete network.wan6
|
|
|
|
|
uci delete network.lan.ipaddr
|
|
|
|
|