|
|
@ -80,33 +80,7 @@ add_wifi_mesh() {
|
|
|
|
uci commit wireless
|
|
|
|
uci commit wireless
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
|
|
if [ "$backbone" = "wifi" ]; then
|
|
|
|
|
|
|
|
# Getting the radio to configure as a client (Assuming $clientRadio is the variable for client radio)
|
|
|
|
|
|
|
|
clientRadio="radio0" # Change this to the actual variable representing the radio to configure as a client
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# Check all existing wifinetX and remove if SSID matches with $apname
|
|
|
|
|
|
|
|
clientnum="${clientRadio#radio}"
|
|
|
|
|
|
|
|
clientnum=$((clientnum + 1))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
while uci get wireless.wifinet$clientnum > /dev/null 2>&1; do
|
|
|
|
|
|
|
|
existing_ssid=$(uci get wireless.wifinet$clientnum.ssid 2> /dev/null)
|
|
|
|
|
|
|
|
if [ "$existing_ssid" = "$apname" ]; then
|
|
|
|
|
|
|
|
uci delete wireless.wifinet$clientnum
|
|
|
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
clientnum=$((clientnum + 1))
|
|
|
|
|
|
|
|
done
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# Add new WiFi client
|
|
|
|
|
|
|
|
uci set wireless.wifinet$clientnum=wifi-iface
|
|
|
|
|
|
|
|
uci set wireless.wifinet$clientnum.device=$clientRadio
|
|
|
|
|
|
|
|
uci set wireless.wifinet$clientnum.mode='sta'
|
|
|
|
|
|
|
|
uci set wireless.wifinet$clientnum.ssid=$apname
|
|
|
|
|
|
|
|
uci set wireless.wifinet$clientnum.encryption='psk2' # Or whatever encryption method is appropriate
|
|
|
|
|
|
|
|
uci set wireless.wifinet$clientnum.key=$appass
|
|
|
|
|
|
|
|
uci set wireless.wifinet$clientnum.network='wwan'
|
|
|
|
|
|
|
|
uci commit wireless
|
|
|
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if [ "$encryption" != 1 ]; then
|
|
|
|
if [ "$encryption" != 1 ]; then
|
|
|
|
apnum="${mesh_apRadio#radio}"
|
|
|
|
apnum="${mesh_apRadio#radio}"
|
|
|
@ -127,7 +101,7 @@ fi
|
|
|
|
uci set wireless.wifinet$apnum.device=$mesh_apRadio
|
|
|
|
uci set wireless.wifinet$apnum.device=$mesh_apRadio
|
|
|
|
uci set wireless.wifinet$apnum.mode='ap'
|
|
|
|
uci set wireless.wifinet$apnum.mode='ap'
|
|
|
|
uci set wireless.wifinet$apnum.ssid=$mesh_id
|
|
|
|
uci set wireless.wifinet$apnum.ssid=$mesh_id
|
|
|
|
uci set wireless.wifinet$apnum.encryption='sae'
|
|
|
|
uci set wireless.wifinet$apnum.encryption='none'
|
|
|
|
uci set wireless.wifinet$apnum.key=$key
|
|
|
|
uci set wireless.wifinet$apnum.key=$key
|
|
|
|
uci set wireless.wifinet$apnum.ieee80211r='1'
|
|
|
|
uci set wireless.wifinet$apnum.ieee80211r='1'
|
|
|
|
uci set wireless.wifinet$apnum.mobility_domain=$mobility_domain
|
|
|
|
uci set wireless.wifinet$apnum.mobility_domain=$mobility_domain
|
|
|
|