Update 'root/etc/init.d/easymesh'

pull/1/head
ben 1 year ago
parent 0bde896279
commit e667e3f093

@ -80,10 +80,33 @@ add_wifi_mesh() {
if [ "$encryption" != 1 ]; then if [ "$encryption" != 1 ]; then
uci set wireless.mesh_$apall.encryption='none' uci set wireless.mesh_$apall.encryption='none'
uci set wireless.wifinet1=wifi-iface
uci set wireless.wifinet1.device=$apall
uci set wireless.wifinet1.mode='ap'
uci set wireless.wifinet1.ssid=$mesh_id
uci set wireless.wifinet1.encryption='none'
uci set wireless.wifinet1.ieee80211r='1'
uci set wireless.wifinet1.mobility_domain=$mobility_domain
uci set wireless.wifinet1.ft_over_ds='0'
uci set wireless.wifinet1.ft_psk_generate_local='1'
uci set wireless.wifinet1.network='lan'
uci delete "wireless.$mesh_apRadio.disabled"
uci commit wireless uci commit wireless
else else
uci set wireless.mesh_$apall.encryption='sae' uci set wireless.mesh_$apall.encryption='sae'
uci set wireless.mesh_$apall.key=$key uci set wireless.mesh_$apall.key=$key
uci set wireless.wifinet1=wifi-iface
uci set wireless.wifinet1.device=$apall
uci set wireless.wifinet1.mode='ap'
uci set wireless.wifinet1.ssid=$mesh_id
uci set wireless.wifinet1.encryption='sae'
uci set wireless.wifinet1.key=$key
uci set wireless.wifinet1.ieee80211r='1'
uci set wireless.wifinet1.mobility_domain=$mobility_domain
uci set wireless.wifinet1.ft_over_ds='0'
uci set wireless.wifinet1.ft_psk_generate_local='1'
uci set wireless.wifinet1.network='lan'
uci delete "wireless.$mesh_apRadio.disabled"
uci commit wireless uci commit wireless
fi fi
} }
@ -145,7 +168,7 @@ set_easymesh() {
uci set network.bat0.routing_algo='BATMAN_IV' uci set network.bat0.routing_algo='BATMAN_IV'
uci set network.bat0.aggregated_ogms='1' uci set network.bat0.aggregated_ogms='1'
uci set network.bat0.ap_isolation='0' uci set network.bat0.ap_isolation='0'
uci set network.bat0.bonding='0' uci set network.bat0.bonding='1'
uci set network.bat0.bridge_loop_avoidance='1' uci set network.bat0.bridge_loop_avoidance='1'
uci set network.bat0.distributed_arp_table='1' uci set network.bat0.distributed_arp_table='1'
uci set network.bat0.fragmentation='1' uci set network.bat0.fragmentation='1'
@ -158,7 +181,7 @@ set_easymesh() {
uci set network.bat0.multicast_mode='1' uci set network.bat0.multicast_mode='1'
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'
uci set network.bat0.orig_bonding='1'
if [ "$role" = "server" ]; then if [ "$role" = "server" ]; then
uci set network.bat0.gw_mode='server' uci set network.bat0.gw_mode='server'
@ -189,12 +212,9 @@ set_easymesh() {
add_dawn add_dawn
if [ "$ap_mode" = 1 ]; then if [ "$ap_mode" = 1 ]; then
#backup wireless
cp /etc/config/wireless /etc/config/wireless.backup cp /etc/config/wireless /etc/config/wireless.backup
#backup network
cp /etc/config/network /etc/config/network.backup cp /etc/config/network /etc/config/network.backup
uci set wireless.mesh_$apall.mesh_fwding='1'
# these services do not run on dumb APs
for i in firewall dnsmasq odhcpd; do for i in firewall dnsmasq odhcpd; do
if /etc/init.d/"$i" enabled; then if /etc/init.d/"$i" enabled; then
/etc/init.d/"$i" disable /etc/init.d/"$i" disable
@ -202,8 +222,6 @@ for i in firewall dnsmasq odhcpd; do
fi fi
done done
# Now switch the lan interface to DHCP client
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 delete network.wan uci delete network.wan
@ -211,16 +229,11 @@ uci delete network.wan6
uci delete network.lan.ipaddr uci delete network.lan.ipaddr
uci delete network.lan.netmask uci delete network.lan.netmask
# change the host name to easymesh node
echo changing the hostname to easymesh echo changing the hostname to easymesh
uci set system.@system[0].hostname=$gateway uci set system.@system[0].hostname=$gateway
# commit all changes
uci commit uci commit
# remove the firewall config
echo removing firewall config echo removing firewall config
mv /etc/config/firewall /etc/config/firewall.restore mv /etc/config/firewall /etc/config/firewall.restore
@ -272,7 +285,7 @@ start() {
} }
stop() { stop() {
return 0 ap_mode_stop()
} }
restart() { restart() {

Loading…
Cancel
Save