From 402586756f99a6f0b8b16d5a58f1b6ccb53a507c Mon Sep 17 00:00:00 2001 From: Michel Roegl-Brunner <73236783+michelroegl-brunner@users.noreply.github.com> Date: Thu, 8 May 2025 15:50:34 +0200 Subject: [PATCH] build.func Change the menu for Bridge Selection (#4326) * Change the menu for Bridge Selection * Change the menu for Bridge Selection * Change the menu for Bridge Selection --- misc/build.func | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/misc/build.func b/misc/build.func index 587c188d9..f8adaa585 100644 --- a/misc/build.func +++ b/misc/build.func @@ -528,15 +528,17 @@ advanced_settings() { exit_script fi - if BRG=$(whiptail --backtitle "Proxmox VE Helper Scripts" --inputbox "Set a Bridge" 8 58 vmbr0 --title "BRIDGE" 3>&1 1>&2 2>&3); then - if [ -z "$BRG" ]; then - BRG="vmbr0" - echo -e "${BRIDGE}${BOLD}${DGN}Bridge: ${BGN}$BRG${CL}" - else - echo -e "${BRIDGE}${BOLD}${DGN}Bridge: ${BGN}$BRG${CL}" - fi + BRIDGES=$( ip link show | grep -oP '(?<=: )vmbr\d+' | sort) + if [[ -z "$BRIDGES" ]]; then + BRG="vmbr0" + echo -e "${BRIDGE}${BOLD}${DGN}Bridge: ${BGN}$BRG${CL}" else - exit_script + BRG=$(whiptail --backtitle "Proxmox VE Helper Scripts" --menu "Select network bridge:" 10 40 6 $(echo "$BRIDGES" | awk '{print $0, "Bridge"}') 3>&1 1>&2 2>&3) + if [ -z "$BRG" ]; then + exit_script + else + echo -e "${BRIDGE}${BOLD}${DGN}Bridge: ${BGN}$BRG${CL}" + fi fi while true; do