|
|
@ -82,61 +82,78 @@ add_wifi_mesh() {
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if [ "$encryption" != 1 ]; then
|
|
|
|
if [ "$encryption" != 1 ]; then
|
|
|
|
apnum="${mesh_apRadio#radio}"
|
|
|
|
apnum="${mesh_apRadio#radio}"
|
|
|
|
apnum=$((apnum + 1))
|
|
|
|
apnum=$((apnum + 1))
|
|
|
|
|
|
|
|
found=0
|
|
|
|
|
|
|
|
|
|
|
|
# Check all existing wifinetX and remove if SSID matches with $mesh_id
|
|
|
|
# Check all existing wifinetX and remove if SSID matches with $mesh_id and mode is 'ap'
|
|
|
|
while uci get wireless.wifinet$apnum > /dev/null 2>&1; do
|
|
|
|
while uci get wireless.wifinet$apnum > /dev/null 2>&1; do
|
|
|
|
existing_ssid=$(uci get wireless.wifinet$apnum.ssid 2> /dev/null)
|
|
|
|
existing_ssid=$(uci get wireless.wifinet$apnum.ssid 2> /dev/null)
|
|
|
|
if [ "$existing_ssid" = "$mesh_id" ]; then
|
|
|
|
existing_mode=$(uci get wireless.wifinet$apnum.mode 2> /dev/null)
|
|
|
|
uci delete wireless.wifinet$apnum
|
|
|
|
if [ "$existing_ssid" = "$mesh_id" ] && [ "$existing_mode" = "ap" ]; then
|
|
|
|
|
|
|
|
if [ $found -eq 0 ]; then
|
|
|
|
|
|
|
|
found=1
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
uci delete wireless.wifinet$apnum
|
|
|
|
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
apnum=$((apnum + 1))
|
|
|
|
apnum=$((apnum + 1))
|
|
|
|
done
|
|
|
|
done
|
|
|
|
uci commit wireless
|
|
|
|
uci commit wireless
|
|
|
|
|
|
|
|
|
|
|
|
uci set wireless.mesh_$apall.encryption='none'
|
|
|
|
if [ $found -eq 0 ]; then
|
|
|
|
uci set wireless.wifinet$apnum=wifi-iface
|
|
|
|
uci set wireless.mesh_$apall.encryption='none'
|
|
|
|
uci set wireless.wifinet$apnum.device=$mesh_apRadio
|
|
|
|
uci set wireless.wifinet$apnum=wifi-iface
|
|
|
|
uci set wireless.wifinet$apnum.mode='ap'
|
|
|
|
uci set wireless.wifinet$apnum.device=$mesh_apRadio
|
|
|
|
uci set wireless.wifinet$apnum.ssid=$mesh_id
|
|
|
|
uci set wireless.wifinet$apnum.mode='ap'
|
|
|
|
uci set wireless.wifinet$apnum.encryption='none'
|
|
|
|
uci set wireless.wifinet$apnum.ssid=$mesh_id
|
|
|
|
uci set wireless.wifinet$apnum.key=$key
|
|
|
|
uci set wireless.wifinet$apnum.encryption='none'
|
|
|
|
uci set wireless.wifinet$apnum.ieee80211r='1'
|
|
|
|
uci set wireless.wifinet$apnum.key=$key
|
|
|
|
uci set wireless.wifinet$apnum.mobility_domain=$mobility_domain
|
|
|
|
uci set wireless.wifinet$apnum.ieee80211r='1'
|
|
|
|
uci set wireless.wifinet$apnum.ft_over_ds='0'
|
|
|
|
uci set wireless.wifinet$apnum.mobility_domain=$mobility_domain
|
|
|
|
uci set wireless.wifinet$apnum.ft_psk_generate_local='1'
|
|
|
|
uci set wireless.wifinet$apnum.ft_over_ds='0'
|
|
|
|
uci set wireless.wifinet$apnum.network='lan'
|
|
|
|
uci set wireless.wifinet$apnum.ft_psk_generate_local='1'
|
|
|
|
uci commit wireless
|
|
|
|
uci set wireless.wifinet$apnum.network='lan'
|
|
|
|
|
|
|
|
uci commit wireless
|
|
|
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
|
|
else
|
|
|
|
else
|
|
|
|
apnum="${mesh_apRadio#radio}"
|
|
|
|
apnum="${mesh_apRadio#radio}"
|
|
|
|
apnum=$((apnum + 1))
|
|
|
|
apnum=$((apnum + 1))
|
|
|
|
|
|
|
|
found=0
|
|
|
|
|
|
|
|
|
|
|
|
# Check all existing wifinetX and remove if SSID matches with $mesh_id
|
|
|
|
# Check all existing wifinetX and remove if SSID matches with $mesh_id and mode is 'ap'
|
|
|
|
while uci get wireless.wifinet$apnum > /dev/null 2>&1; do
|
|
|
|
while uci get wireless.wifinet$apnum > /dev/null 2>&1; do
|
|
|
|
existing_ssid=$(uci get wireless.wifinet$apnum.ssid 2> /dev/null)
|
|
|
|
existing_ssid=$(uci get wireless.wifinet$apnum.ssid 2> /dev/null)
|
|
|
|
if [ "$existing_ssid" = "$mesh_id" ]; then
|
|
|
|
existing_mode=$(uci get wireless.wifinet$apnum.mode 2> /dev/null)
|
|
|
|
uci delete wireless.wifinet$apnum
|
|
|
|
if [ "$existing_ssid" = "$mesh_id" ] && [ "$existing_mode" = "ap" ]; then
|
|
|
|
|
|
|
|
if [ $found -eq 0 ]; then
|
|
|
|
|
|
|
|
found=1
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
uci delete wireless.wifinet$apnum
|
|
|
|
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
apnum=$((apnum + 1))
|
|
|
|
apnum=$((apnum + 1))
|
|
|
|
done
|
|
|
|
done
|
|
|
|
uci commit wireless
|
|
|
|
uci commit wireless
|
|
|
|
|
|
|
|
|
|
|
|
uci set wireless.mesh_$apall.encryption='sae'
|
|
|
|
if [ $found -eq 0 ]; then
|
|
|
|
uci set wireless.mesh_$apall.key=$key
|
|
|
|
uci set wireless.mesh_$apall.encryption='sae'
|
|
|
|
uci set wireless.wifinet$apnum=wifi-iface
|
|
|
|
uci set wireless.mesh_$apall.key=$key
|
|
|
|
uci set wireless.wifinet$apnum.device=$apall
|
|
|
|
uci set wireless.wifinet$apnum=wifi-iface
|
|
|
|
uci set wireless.wifinet$apnum.mode='ap'
|
|
|
|
uci set wireless.wifinet$apnum.device=$apall
|
|
|
|
uci set wireless.wifinet$apnum.ssid=$mesh_id
|
|
|
|
uci set wireless.wifinet$apnum.mode='ap'
|
|
|
|
uci set wireless.wifinet$apnum.encryption='sae'
|
|
|
|
uci set wireless.wifinet$apnum.ssid=$mesh_id
|
|
|
|
uci set wireless.wifinet$apnum.key=$key
|
|
|
|
uci set wireless.wifinet$apnum.encryption='sae'
|
|
|
|
uci set wireless.wifinet$apnum.ieee80211r='1'
|
|
|
|
uci set wireless.wifinet$apnum.key=$key
|
|
|
|
uci set wireless.wifinet$apnum.mobility_domain=$mobility_domain
|
|
|
|
uci set wireless.wifinet$apnum.ieee80211r='1'
|
|
|
|
uci set wireless.wifinet$apnum.ft_over_ds='0'
|
|
|
|
uci set wireless.wifinet$apnum.mobility_domain=$mobility_domain
|
|
|
|
uci set wireless.wifinet$apnum.ft_psk_generate_local='1'
|
|
|
|
uci set wireless.wifinet$apnum.ft_over_ds='0'
|
|
|
|
uci set wireless.wifinet$apnum.network='lan'
|
|
|
|
uci set wireless.wifinet$apnum.ft_psk_generate_local='1'
|
|
|
|
uci commit wireless
|
|
|
|
uci set wireless.wifinet$apnum.network='lan'
|
|
|
|
|
|
|
|
uci commit wireless
|
|
|
|
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|