Revert: Change Bridge detection to inlcude interface.vlan bridges as well
Some checks failed
Bump build.func Revision / bump-revision (push) Has been cancelled

This commit is contained in:
Michel Roegl-Brunner 2025-10-10 09:28:20 +02:00
parent d0b4fd9f5f
commit b006c4f74b

View File

@ -598,7 +598,7 @@ advanced_settings() {
start=$(echo "${pair}" | cut -d':' -f1) start=$(echo "${pair}" | cut -d':' -f1)
end=$(echo "${pair}" | cut -d':' -f2) end=$(echo "${pair}" | cut -d':' -f2)
if awk "NR >= ${start} && NR <= ${end}" "${iface_filepath}" | grep -qP '^\s*(bridge[-_](ports|stp|fd|vlan-aware|vids)|ovs_type\s+OVSBridge|vlan-raw-device)\b'; then if awk "NR >= ${start} && NR <= ${end}" "${iface_filepath}" | grep -qP '^\s*(bridge[-_](ports|stp|fd|vlan-aware|vids)|ovs_type\s+OVSBridge)\b'; then
iface_name=$(sed "${start}q;d" "${iface_filepath}" | awk '{print $2}') iface_name=$(sed "${start}q;d" "${iface_filepath}" | awk '{print $2}')
BRIDGES="${iface_name}"$'\n'"${BRIDGES}" BRIDGES="${iface_name}"$'\n'"${BRIDGES}"
fi fi
@ -618,23 +618,8 @@ advanced_settings() {
BRIDGE_MENU_OPTIONS=() BRIDGE_MENU_OPTIONS=()
while IFS= read -r bridge; do while IFS= read -r bridge; do
if [[ -n "$bridge" ]]; then if [[ -n "$bridge" ]]; then
# Check if this is a VLAN interface (pattern: name.vlan_id) # Get description from Proxmox built-in method - find comment for this specific bridge
if [[ "$bridge" =~ ^(.+)\.([0-9]+)$ ]]; then description=$(grep -A 10 "iface $bridge" /etc/network/interfaces | grep '^#' | head -n1 | sed 's/^#\s*//')
parent_device="${BASH_REMATCH[1]}"
vlan_id="${BASH_REMATCH[2]}"
# Try to get the actual parent device from vlan-raw-device line
vlan_raw_device=$(grep -A 10 "iface $bridge" /etc/network/interfaces | grep '^\s*vlan-raw-device' | awk '{print $2}')
if [[ -n "$vlan_raw_device" ]]; then
parent_device="$vlan_raw_device"
fi
description="VLAN $vlan_id on $parent_device"
else
# Regular bridge - get description from Proxmox built-in method - find comment for this specific bridge
description=$(grep -A 10 "iface $bridge" /etc/network/interfaces | grep '^#' | head -n1 | sed 's/^#\s*//')
fi
if [[ -n "$description" ]]; then if [[ -n "$description" ]]; then
BRIDGE_MENU_OPTIONS+=("$bridge" "${description}") BRIDGE_MENU_OPTIONS+=("$bridge" "${description}")
else else