map-agent: hotplug: map-dynamic-backhaul: remove tracking of port connections prior to dynbh start

This commit is contained in:
Jakob Olsson 2025-05-21 15:50:17 +02:00
parent 67ee062946
commit 9a5564bca4

View file

@ -1,6 +1,5 @@
#!/bin/sh
conn_ports_file="/var/run/multiap/map.connected.ports"
map_bh_file="/var/run/multiap/multiap.backhaul"
# Exit if AL Bridge is not configured to be a bridge device
@ -30,30 +29,6 @@ al_brnet="${al_bridge:3}"
############## Dynamic Backhaul Daemon ##############
if [ -n "$(which dynbhd)" ]; then
pidof dynbhd >/dev/null && exit 0 # dynbhd is managing the links
if [ ! -f $conn_ports_file ]; then
mkdir -p /var/run/multiap
touch $conn_ports_file
if [ "$LINK" = "up" ]; then
touch $conn_ports_file
echo "$PORT" > $conn_ports_file
brctl delif $al_bridge $PORT
#ubus call network.interface.lan remove_device "{\"name\":\"$PORT\"}"
fi
else
if [ "$LINK" = "up" ]; then
brctl delif $al_bridge $PORT
echo "$PORT" >> $conn_ports_file
#ubus call network.interface.lan remove_device "{\"name\":\"$PORT\"}"
else
sed -i -E "/(^|:)${PORT}(:|$)/d" $conn_ports_file
#ubus call network.interface.lan add_device "{\"name\":\"$PORT\"}"
brctl addif $al_bridge $PORT
[ "$(cat $conn_ports_file | wc -c)" = "0" ] && rm -f $conn_ports_file
fi
fi
exit 0
fi
########################################################