Update create_lxc.sh

This commit is contained in:
CanbiZ 2025-07-01 15:34:54 +02:00
parent 0a1d2637ff
commit 82dcad5cae

View File

@ -144,16 +144,25 @@ function select_storage() {
fi fi
local WIDTH=$((COL_WIDTH + 42)) local WIDTH=$((COL_WIDTH + 42))
local DISPLAY_SELECTED local DISPLAY_SELECTED=""
DISPLAY_SELECTED=$(whiptail --backtitle "Proxmox VE Helper Scripts" --title "Storage Pools" --radiolist \ while true; do
"Which storage pool for ${CONTENT_LABEL,,}?\n(Spacebar to select)" \ DISPLAY_SELECTED=$(whiptail --backtitle "Proxmox VE Helper Scripts" --title "Storage Pools" --radiolist \
16 "$WIDTH" 6 "${MENU[@]}" 3>&1 1>&2 2>&3) || { "Which storage pool for ${CONTENT_LABEL,,}?\n(Spacebar to select)" \
printf "\e[?25h" 16 "$WIDTH" 6 "${MENU[@]}" 3>&1 1>&2 2>&3) || {
msg_error "Storage selection cancelled by user. Aborting script." msg_error "Storage selection cancelled by user."
exit 202 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"]}" echo "${STORAGE_MAP["$DISPLAY_SELECTED"]}"
} }
# Test if required variables are set # Test if required variables are set