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