From d9be26d116d0b8bacb643e35f026999121780112 Mon Sep 17 00:00:00 2001 From: Michel Roegl-Brunner Date: Thu, 15 May 2025 16:10:17 +0200 Subject: [PATCH] build.func --- misc/build.func | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/misc/build.func b/misc/build.func index db0e240..691369a 100644 --- a/misc/build.func +++ b/misc/build.func @@ -43,13 +43,15 @@ error_handler() { post_update_to_api "failed" "${command}" echo -e "\n$error_message\n" - read -p "Remove this Container? " prompt - if [[ "${prompt,,}" =~ ^(y|yes)$ ]]; then - pct stop "$CTID" - pct destroy "$CTID" - msg_ok "Removed this script" - else - msg_warn "Did not remove this script" + if [[ -n "$CTD_ID" ]]; then + read -p "Remove this Container? " prompt + if [[ "${prompt,,}" =~ ^(y|yes)$ ]]; then + pct stop "$CTID" + pct destroy "$CTID" + msg_ok "Removed this script" + else + msg_warn "Did not remove this script" + fi fi } # Check if the shell is using bash