From d10c404b608b8659ad16e189118046661ea69c4a Mon Sep 17 00:00:00 2001 From: CanbiZ <47820557+MickLesk@users.noreply.github.com> Date: Mon, 9 Dec 2024 09:24:57 +0100 Subject: [PATCH] Update create_lxc.sh --- ct/create_lxc.sh | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/ct/create_lxc.sh b/ct/create_lxc.sh index 5bd16643f..6736d5f19 100644 --- a/ct/create_lxc.sh +++ b/ct/create_lxc.sh @@ -15,9 +15,7 @@ YW=$(echo "\033[33m") YWB=$(echo "\033[93m") BL=$(echo "\033[36m") RD=$(echo "\033[01;31m") -BGN=$(echo "\033[4;92m") GN=$(echo "\033[1;92m") -DGN=$(echo "\033[32m") # Formatting CL=$(echo "\033[m") @@ -66,7 +64,7 @@ function spinner() { # This function displays an informational message with a yellow color. function msg_info() { local msg="$1" - echo -ne "${TAB}${YW}${msg}" + echo -ne "${TAB}${YW}${HOLD}${msg}${HOLD}" spinner & SPINNER_PID=$! } @@ -141,11 +139,14 @@ function select_storage() { "Which storage pool you would like to use for the ${CONTENT_LABEL,,}?\nTo make a selection, use the Spacebar.\n" \ 16 $(($MSG_MAX_LENGTH + 23)) 6 \ "${MENU[@]}" 3>&1 1>&2 2>&3) || exit "Menu aborted." + if [ $? -ne 0 ]; then + echo -e "${CROSS}${RD} Menu aborted by user.${CL}" + exit 0 + fi done - printf $STORAGE + printf "%s" "$STORAGE" fi } - # Test if required variables are set [[ "${CTID:-}" ]] || exit "You need to set 'CTID' variable." [[ "${PCT_OSTYPE:-}" ]] || exit "You need to set 'PCT_OSTYPE' variable."