|
|
@ -19,6 +19,8 @@ load_easymesh_config() {
|
|
|
|
backbone=$(uci get easymesh.@easymesh[0].backbone)
|
|
|
|
backbone=$(uci get easymesh.@easymesh[0].backbone)
|
|
|
|
apname=$(uci get easymesh.@easymesh[0].apname)
|
|
|
|
apname=$(uci get easymesh.@easymesh[0].apname)
|
|
|
|
appass=$(uci get easymesh.@easymesh[0].appass)
|
|
|
|
appass=$(uci get easymesh.@easymesh[0].appass)
|
|
|
|
|
|
|
|
# On a single line, print all of the variables to a file
|
|
|
|
|
|
|
|
printf "enable: $enable\nmesh_bat0: $mesh_bat0\nap_mode: $ap_mode\nlan: $lan\nipaddr: $ipaddr\nnetmask: $netmask\ngateway: $gateway\ndns: $dns\nap_ipaddr: $ap_ipaddr\nap_ipaddr1: $ap_ipaddr1\napRadio: $apRadio\nkvr: $kvr\niapp: $iapp\nbrlan: $brlan\nrole: $role\nbackbone: $backbone\napname: $apname\nappass: $appass" > /root/.easymesh
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
ap_mode_stop() {
|
|
|
|
ap_mode_stop() {
|
|
|
@ -50,7 +52,7 @@ add_wifi_mesh() {
|
|
|
|
key=$(uci -q get easymesh.config.key)
|
|
|
|
key=$(uci -q get easymesh.config.key)
|
|
|
|
encryption=$(uci -q get easymesh.config.encryption)
|
|
|
|
encryption=$(uci -q get easymesh.config.encryption)
|
|
|
|
# Print out all the variables
|
|
|
|
# Print out all the variables
|
|
|
|
echo "mesh_nwi_mesh: $mesh_nwi_mesh\nmesh_apRadio: $mesh_apRadio\nmesh_mesh: $mesh_mesh\nmesh_id: $mesh_id\nmobility_domain: $mobility_domain\nkey: $key\nencryption: $encryption" > /root/.newmesh
|
|
|
|
printf "mesh_nwi_mesh: $mesh_nwi_mesh\nmesh_apRadio: $mesh_apRadio\nmesh_mesh: $mesh_mesh\nmesh_id: $mesh_id\nmobility_domain: $mobility_domain\nkey: $key\nencryption: $encryption" > /root/.newmesh
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if [ "$mesh_nwi_mesh" != "interface" ]; then
|
|
|
|
if [ "$mesh_nwi_mesh" != "interface" ]; then
|
|
|
@ -155,7 +157,7 @@ add_wifi_mesh() {
|
|
|
|
uci set wireless.wifinet$apnum.device=$apall
|
|
|
|
uci set wireless.wifinet$apnum.device=$apall
|
|
|
|
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='psk2'
|
|
|
|
uci set wireless.wifinet$apnum.encryption='sae-mixed'
|
|
|
|
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
|
|
|
@ -239,7 +241,6 @@ set_easymesh() {
|
|
|
|
uci set network.bat0.network_coding='0'
|
|
|
|
uci set network.bat0.network_coding='0'
|
|
|
|
uci set network.bat0.orig_interval='1000'
|
|
|
|
uci set network.bat0.orig_interval='1000'
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if [ "$role" = "server" ]; then
|
|
|
|
if [ "$role" = "server" ]; then
|
|
|
|
uci set network.bat0.gw_mode='server'
|
|
|
|
uci set network.bat0.gw_mode='server'
|
|
|
|
elif [ "$role" = "client" ]; then
|
|
|
|
elif [ "$role" = "client" ]; then
|
|
|
@ -258,14 +259,18 @@ set_easymesh() {
|
|
|
|
fi # end [ "$mesh_bat0" != "interface" ]
|
|
|
|
fi # end [ "$mesh_bat0" != "interface" ]
|
|
|
|
|
|
|
|
|
|
|
|
# When this is called, the add_wifi_mesh function does not load variables properly
|
|
|
|
# When this is called, the add_wifi_mesh function does not load variables properly
|
|
|
|
# if [ "$apRadio" = "all" ]; then
|
|
|
|
if [ "$apRadio" = "all" ]; then
|
|
|
|
# for apall in $(uci -X show wireless | grep wifi-device | awk -F'[.=]' '{print $2}'); do
|
|
|
|
for apall in $(uci -X show wireless | grep wifi-device | awk -F'[.=]' '{print $2}'); do
|
|
|
|
# add_wifi_mesh
|
|
|
|
add_wifi_mesh
|
|
|
|
# done
|
|
|
|
add_kvr
|
|
|
|
# else
|
|
|
|
add_dawn
|
|
|
|
# apall=$apRadio
|
|
|
|
done
|
|
|
|
# add_wifi_mesh
|
|
|
|
else
|
|
|
|
# fi
|
|
|
|
apall=$apRadio
|
|
|
|
|
|
|
|
add_wifi_mesh
|
|
|
|
|
|
|
|
add_kvr
|
|
|
|
|
|
|
|
add_dawn
|
|
|
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
|
|
add_kvr
|
|
|
|
add_kvr
|
|
|
|
add_dawn
|
|
|
|
add_dawn
|
|
|
@ -335,7 +340,7 @@ set_easymesh() {
|
|
|
|
else
|
|
|
|
else
|
|
|
|
ap_mode_stop
|
|
|
|
ap_mode_stop
|
|
|
|
fi # end if [ "$ap_mode" = 1 ]
|
|
|
|
fi # end if [ "$ap_mode" = 1 ]
|
|
|
|
|
|
|
|
else
|
|
|
|
if [ "$mesh_bat0" = "interface" ]; then
|
|
|
|
if [ "$mesh_bat0" = "interface" ]; then
|
|
|
|
uci -q delete network.bat0
|
|
|
|
uci -q delete network.bat0
|
|
|
|
if [ "$brlan" = "br-lan" ]; then
|
|
|
|
if [ "$brlan" = "br-lan" ]; then
|
|
|
@ -360,27 +365,15 @@ set_easymesh() {
|
|
|
|
uci commit wireless
|
|
|
|
uci commit wireless
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
done
|
|
|
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
|
|
add_kvr
|
|
|
|
if [ "$ap_mode" = 0 ]; then
|
|
|
|
add_dawn
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if [ "$ap_mode" = 1 ]; then
|
|
|
|
|
|
|
|
ap_mode_stop
|
|
|
|
ap_mode_stop
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
|
|
|
/etc/init.d/network restart
|
|
|
|
/etc/init.d/network restart
|
|
|
|
} # end set_easymesh()
|
|
|
|
} # end set_easymesh()
|
|
|
|
|
|
|
|
|
|
|
|
# Call our functions set above
|
|
|
|
# Call our functions set above
|
|
|
|
load_easymesh_config
|
|
|
|
load_easymesh_config
|
|
|
|
set_easymesh
|
|
|
|
set_easymesh
|
|
|
|
|
|
|
|
|
|
|
|
if [ "$apRadio" = "all" ]; then
|
|
|
|
|
|
|
|
for apall in $(uci -X show wireless | grep wifi-device | awk -F'[.=]' '{print $2}'); do
|
|
|
|
|
|
|
|
add_wifi_mesh
|
|
|
|
|
|
|
|
done
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
apall=$apRadio
|
|
|
|
|
|
|
|
add_wifi_mesh
|
|
|
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|