From c7a0b671cbbe1206f5baba0f928ed382d817f2fb Mon Sep 17 00:00:00 2001 From: CanbiZ <47820557+MickLesk@users.noreply.github.com> Date: Tue, 1 Jul 2025 15:08:43 +0200 Subject: [PATCH] Update create_lxc.sh --- misc/create_lxc.sh | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/misc/create_lxc.sh b/misc/create_lxc.sh index 13e23ff4..c12e9cd6 100644 --- a/misc/create_lxc.sh +++ b/misc/create_lxc.sh @@ -194,10 +194,28 @@ if [[ -f "$DEFAULT_FILE" ]]; then msg_ok "Using ${BL}$CONTAINER_STORAGE${CL} ${GN}for Container Storage." fi else - TEMPLATE_STORAGE=$(select_storage template) + # TEMPLATE STORAGE SELECTION + if ! TEMPLATE_STORAGE=$(select_storage template); then + [[ $? -eq 202 ]] && { + msg_error "Template Storage selection cancelled by user. Exiting cleanly." + exit 202 + } + msg_error "Unexpected error during template storage selection." + exit 1 + fi msg_ok "Using ${BL}$TEMPLATE_STORAGE${CL} ${GN}for Template Storage." - CONTAINER_STORAGE=$(select_storage container) + + # CONTAINER STORAGE SELECTION + if ! CONTAINER_STORAGE=$(select_storage container); then + [[ $? -eq 202 ]] && { + msg_error "Container Storage selection cancelled by user. Exiting cleanly." + exit 202 + } + msg_error "Unexpected error during container storage selection." + exit 1 + fi msg_ok "Using ${BL}$CONTAINER_STORAGE${CL} ${GN}for Container Storage." + fi # Check free space on selected container storage