Skip to content

Commit 4025867

Browse files
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
1 parent 19800da commit 4025867

File tree

1 file changed

+10
-8
lines changed

1 file changed

+10
-8
lines changed

misc/build.func

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -528,15 +528,17 @@ advanced_settings() {
528528
exit_script
529529
fi
530530

531-
if BRG=$(whiptail --backtitle "Proxmox VE Helper Scripts" --inputbox "Set a Bridge" 8 58 vmbr0 --title "BRIDGE" 3>&1 1>&2 2>&3); then
532-
if [ -z "$BRG" ]; then
533-
BRG="vmbr0"
534-
echo -e "${BRIDGE}${BOLD}${DGN}Bridge: ${BGN}$BRG${CL}"
535-
else
536-
echo -e "${BRIDGE}${BOLD}${DGN}Bridge: ${BGN}$BRG${CL}"
537-
fi
531+
BRIDGES=$( ip link show | grep -oP '(?<=: )vmbr\d+' | sort)
532+
if [[ -z "$BRIDGES" ]]; then
533+
BRG="vmbr0"
534+
echo -e "${BRIDGE}${BOLD}${DGN}Bridge: ${BGN}$BRG${CL}"
538535
else
539-
exit_script
536+
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)
537+
if [ -z "$BRG" ]; then
538+
exit_script
539+
else
540+
echo -e "${BRIDGE}${BOLD}${DGN}Bridge: ${BGN}$BRG${CL}"
541+
fi
540542
fi
541543

542544
while true; do

0 commit comments

Comments
 (0)