mirror of
https://dev.iopsys.eu/feed/iopsys.git
synced 2025-12-10 07:44:50 +01:00
map-agent: hotplug: map-dynamic-backhaul: Refactor port filtering and bridge detection logic
This commit is contained in:
parent
f8561996ab
commit
e87bcbb819
1 changed files with 14 additions and 2 deletions
|
|
@ -7,9 +7,21 @@ map_bh_file="/var/run/multiap/multiap.backhaul"
|
||||||
al_bridge="$(uci -q get mapagent.agent.al_bridge)"
|
al_bridge="$(uci -q get mapagent.agent.al_bridge)"
|
||||||
[ "${al_bridge:0:3}" = "br-" ] || exit 0
|
[ "${al_bridge:0:3}" = "br-" ] || exit 0
|
||||||
|
|
||||||
|
# Get all sections where the port appears in 'ports' list
|
||||||
|
port_bridge_sec_list="$(uci show network | grep -w $PORT | grep '\.ports' | cut -d'.' -f2)"
|
||||||
|
|
||||||
|
# Find the first section with type='bridge' and get its name
|
||||||
|
for port_bridge_sec in $port_bridge_sec_list; do
|
||||||
|
if [ "$(uci -q get network.$port_bridge_sec.type)" = "bridge" ]; then
|
||||||
|
port_bridge_name="$(uci -q get network.$port_bridge_sec.name)"
|
||||||
|
break
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
|
||||||
|
# Exit if the PORT Bridge Name is empty
|
||||||
|
[ -z "$port_bridge_name" ] && exit 0
|
||||||
|
|
||||||
# Exit if the PORT is not member of the AL Bridge
|
# Exit if the PORT is not member of the AL Bridge
|
||||||
port_bridge_sec="$(uci show network | grep -w $PORT | grep '\.ports' | cut -d'.' -f2)"
|
|
||||||
port_bridge_name="$(uci -q get network.$port_bridge_sec.name)"
|
|
||||||
[ "$port_bridge_name" = "$al_bridge" ] || exit 0
|
[ "$port_bridge_name" = "$al_bridge" ] || exit 0
|
||||||
|
|
||||||
# Exit if the device is not operating in extender/repeater mode
|
# Exit if the device is not operating in extender/repeater mode
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue