From a9ee733090fd23b10454b70ea3ab7f8a35e9e37d Mon Sep 17 00:00:00 2001 From: Jason Hawks Date: Mon, 13 Nov 2023 19:58:00 -0500 Subject: [PATCH] New Bat Test --- root/easymesh/easymesh.sh | 40 ++++++++++++++++++++++++--------------- 1 file changed, 25 insertions(+), 15 deletions(-) diff --git a/root/easymesh/easymesh.sh b/root/easymesh/easymesh.sh index ece9d54..2199da1 100644 --- a/root/easymesh/easymesh.sh +++ b/root/easymesh/easymesh.sh @@ -73,9 +73,19 @@ create_bat0() { echo "Old bat0 interface deleted from lan network." fi - # Add 'bat0' to the list of ports for 'br-lan' - uci add_list network.@device[0].ports='bat0' - echo "bat0 has been added to the lan network." + # # Add 'bat0' to the list of ports for 'br-lan' + # uci add_list network.@device[0].ports='bat0' + # echo "bat0 has been added to the lan network." + + # Get the LAN bridge name + LAN_NAME=$(uci -q get network.@device[0].name) + + # Setup our Private Router Batman Interface + uci set network.private_router_batman=interface + uci set network.private_router_batman.proto='batadv_hardif' + uci set network.private_router_batman.master='bat0' + uci set network.private_router_batman.device="$LAN_NAME" + uci set network.private_router_batman.mtu='1536' uci commit network fi @@ -126,18 +136,18 @@ setup_mesh_radio() { # Commit changes to wireless uci commit wireless - uci set network.nwi_mesh_$CURRENT_RADIO=interface - uci set network.nwi_mesh_$CURRENT_RADIO.proto='batadv_hardif' - uci set network.nwi_mesh_$CURRENT_RADIO.master='bat0' - uci set network.nwi_mesh_$CURRENT_RADIO.device='bat0' - uci set network.nwi_mesh_$CURRENT_RADIO.mtu='1536' + # uci set network.nwi_mesh_$CURRENT_RADIO=interface + # uci set network.nwi_mesh_$CURRENT_RADIO.proto='batadv_hardif' + # uci set network.nwi_mesh_$CURRENT_RADIO.master='bat0' + # uci set network.nwi_mesh_$CURRENT_RADIO.device='bat0' + # uci set network.nwi_mesh_$CURRENT_RADIO.mtu='1536' - uci set wireless.mesh_$CURRENT_RADIO=wifi-iface - uci set wireless.mesh_$CURRENT_RADIO.device=$CURRENT_RADIO - uci set wireless.mesh_$CURRENT_RADIO.ifname=mesh_$CURRENT_RADIO - uci set wireless.mesh_$CURRENT_RADIO.network=nwi_mesh_$CURRENT_RADIO + uci set wireless.mesh_$CURRENT_RADIO='wifi-iface' + uci set wireless.mesh_$CURRENT_RADIO.device="$CURRENT_RADIO" + uci set wireless.mesh_$CURRENT_RADIO.ifname="mesh_$CURRENT_RADIO" + uci set wireless.mesh_$CURRENT_RADIO.network='private_router_batman' uci set wireless.mesh_$CURRENT_RADIO.mode='mesh' - uci set wireless.mesh_$CURRENT_RADIO.mesh_id=$MESH_NAME + uci set wireless.mesh_$CURRENT_RADIO.mesh_id="$MESH_NAME" uci set wireless.mesh_$CURRENT_RADIO.mesh_fwding='0' uci set wireless.mesh_$CURRENT_RADIO.mesh_rssi_threshold='0' uci set wireless.mesh_$CURRENT_RADIO.mesh_ttl='1' @@ -288,8 +298,8 @@ disable_easymesh() { # Loop through all the radios and delete the network interfaces for CURRENT_RADIO in $WIFI_RADIOS; do echo "Handling removal of mesh networks for: $CURRENT_RADIO" - if [ "$(uci -q get network.nwi_mesh_$CURRENT_RADIO)" = "interface" ]; then - uci del network.nwi_mesh_$CURRENT_RADIO + if [ "$(uci -q get network.private_router_batman)" = "interface" ]; then + uci del network.private_router_batman uci commit network fi done