diff --git a/misc/build.func b/misc/build.func index b50cd1b5..1b39a80f 100644 --- a/misc/build.func +++ b/misc/build.func @@ -977,8 +977,9 @@ install_script() { header_info while true; do - CHOICE=$(whiptail --backtitle "[dev] Proxmox VE Helper Scripts" --title "SETTINGS" --menu "Choose an option:" \ - 20 60 7 \ + TMP_CHOICE=$(whiptail --backtitle "[dev] Proxmox VE Helper Scripts" \ + --title "SETTINGS" \ + --menu "Choose an option:" 20 60 7 \ "1" "Default Settings" \ "2" "Default Settings (with verbose)" \ "3" "Advanced Settings" \ @@ -986,13 +987,15 @@ install_script() { "5" "Manage Default Storage" \ "6" "Diagnostic Settings" \ "7" "Exit" \ - --default-item "1" 3>&1 1>&2 2>&3) + --default-item "1" 3>&1 1>&2 2>&3) || true - if [ $? -ne 0 ] || [ -z "$CHOICE" ]; then - echo -e "${CROSS}${RD}Menu canceled. Exiting.${CL}" + if [ -z "$TMP_CHOICE" ]; then + echo -e "\n${CROSS}${RD}Menu canceled (ESC pressed). Exiting script.${CL}\n" exit 0 fi + CHOICE="$TMP_CHOICE" + case $CHOICE in 1) header_info