From 54aa5f7b2d69c1f9e508fa5d04cc8d80288421f2 Mon Sep 17 00:00:00 2001 From: CanbiZ <47820557+MickLesk@users.noreply.github.com> Date: Mon, 28 Jul 2025 09:17:03 +0200 Subject: [PATCH] better error_handling --- misc/core.func | 6 ------ misc/create_lxc.sh | 8 ++++++++ 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/misc/core.func b/misc/core.func index f7e48d41..e06d98f8 100644 --- a/misc/core.func +++ b/misc/core.func @@ -415,12 +415,6 @@ msg_custom() { echo -e "${BFR:-} ${symbol} ${color}${msg}${CL:-\e[0m}" } -exit_script() { - clear - echo -e "\n${CROSS}${RD}User exited script${CL}\n" - exit -} - run_container_safe() { local ct="$1" shift diff --git a/misc/create_lxc.sh b/misc/create_lxc.sh index 93d06bd0..7cc7b702 100644 --- a/misc/create_lxc.sh +++ b/misc/create_lxc.sh @@ -50,6 +50,14 @@ function on_terminate() { exit 143 } +exit_script() { + clear + printf "\e[?25h" + echo -e "\n${CROSS}${RD}User exited script${CL}\n" + kill 0 + exit 1 +} + function check_storage_support() { local CONTENT="$1" local -a VALID_STORAGES=()