Update create_lxc.sh
This commit is contained in:
parent
95491b42c8
commit
4012dd3dcd
@ -146,24 +146,28 @@ function select_storage() {
|
|||||||
local WIDTH=$((COL_WIDTH + 42))
|
local WIDTH=$((COL_WIDTH + 42))
|
||||||
local DISPLAY_SELECTED=""
|
local DISPLAY_SELECTED=""
|
||||||
while true; do
|
while true; do
|
||||||
DISPLAY_SELECTED=$(whiptail --backtitle "Proxmox VE Helper Scripts" --title "Storage Pools" --radiolist \
|
DISPLAY_SELECTED=$(whiptail --backtitle "Proxmox VE Helper Scripts" \
|
||||||
"Which storage pool for ${CONTENT_LABEL,,}?\n(Spacebar to select)" \
|
--title "Storage Pools" \
|
||||||
|
--radiolist "Which storage pool for ${CONTENT_LABEL,,}?\n(Spacebar to select)" \
|
||||||
16 "$WIDTH" 6 "${MENU[@]}" 3>&1 1>&2 2>&3)
|
16 "$WIDTH" 6 "${MENU[@]}" 3>&1 1>&2 2>&3)
|
||||||
|
|
||||||
local ret=$?
|
local exit_code=$?
|
||||||
if [[ $ret -ne 0 ]]; then
|
if [ $exit_code -ne 0 ]; then
|
||||||
msg_error "Storage selection cancelled by user."
|
msg_error "Storage selection cancelled by user."
|
||||||
exit 202
|
exit 202
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ -z "$DISPLAY_SELECTED" || -z "${STORAGE_MAP[$DISPLAY_SELECTED]+_}" ]]; then
|
if [ -z "$DISPLAY_SELECTED" ]; then
|
||||||
whiptail --backtitle "Proxmox VE Helper Scripts" --title "Invalid Selection" \
|
whiptail --msgbox "You must select a storage pool to continue." 8 58
|
||||||
--msgbox "No valid storage selected. Please choose a storage pool to continue." 9 60
|
|
||||||
continue
|
continue
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo "${STORAGE_MAP[$DISPLAY_SELECTED]}"
|
if [[ -n "${STORAGE_MAP[$DISPLAY_SELECTED]:-}" ]]; then
|
||||||
return
|
echo "${STORAGE_MAP[$DISPLAY_SELECTED]}"
|
||||||
|
return
|
||||||
|
else
|
||||||
|
whiptail --msgbox "Invalid selection. Please try again." 8 58
|
||||||
|
fi
|
||||||
done
|
done
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user