From 82dcad5cae2faf7b2818f1fe741ee0da33a82af8 Mon Sep 17 00:00:00 2001 From: CanbiZ <47820557+MickLesk@users.noreply.github.com> Date: Tue, 1 Jul 2025 15:34:54 +0200 Subject: [PATCH] Update create_lxc.sh --- misc/create_lxc.sh | 25 +++++++++++++++++-------- 1 file changed, 17 insertions(+), 8 deletions(-) diff --git a/misc/create_lxc.sh b/misc/create_lxc.sh index 8ecbe03f..87b3c0c0 100644 --- a/misc/create_lxc.sh +++ b/misc/create_lxc.sh @@ -144,16 +144,25 @@ function select_storage() { fi local WIDTH=$((COL_WIDTH + 42)) - local DISPLAY_SELECTED - DISPLAY_SELECTED=$(whiptail --backtitle "Proxmox VE Helper Scripts" --title "Storage Pools" --radiolist \ - "Which storage pool for ${CONTENT_LABEL,,}?\n(Spacebar to select)" \ - 16 "$WIDTH" 6 "${MENU[@]}" 3>&1 1>&2 2>&3) || { - printf "\e[?25h" - msg_error "Storage selection cancelled by user. Aborting script." - exit 202 - } + local DISPLAY_SELECTED="" + while true; do + DISPLAY_SELECTED=$(whiptail --backtitle "Proxmox VE Helper Scripts" --title "Storage Pools" --radiolist \ + "Which storage pool for ${CONTENT_LABEL,,}?\n(Spacebar to select)" \ + 16 "$WIDTH" 6 "${MENU[@]}" 3>&1 1>&2 2>&3) || { + msg_error "Storage selection cancelled by user." + exit 202 + } + + if [[ -z "$DISPLAY_SELECTED" ]]; then + whiptail --backtitle "Proxmox VE Helper Scripts" --title "Invalid Selection" \ + --msgbox "No storage selected. Please choose a storage pool to continue." 9 60 + else + break + fi + done echo "${STORAGE_MAP["$DISPLAY_SELECTED"]}" + } # Test if required variables are set