From 40e0159a6838b70aa4d4158bacd78701587b171c Mon Sep 17 00:00:00 2001 From: CanbiZ <47820557+MickLesk@users.noreply.github.com> Date: Wed, 7 May 2025 16:05:08 +0200 Subject: [PATCH] cleanup --- ct/create_lxc.sh | 1 - misc/alpine-install.func | 2 -- misc/build.func | 4 ---- misc/install.func | 2 -- 4 files changed, 9 deletions(-) diff --git a/ct/create_lxc.sh b/ct/create_lxc.sh index 4591282..21e904b 100644 --- a/ct/create_lxc.sh +++ b/ct/create_lxc.sh @@ -25,7 +25,6 @@ trap 'error_handler $LINENO "$BASH_COMMAND"' ERR # This function handles errors function error_handler() { - if [ -n "$SPINNER_PID" ] && ps -p $SPINNER_PID >/dev/null; then kill $SPINNER_PID >/dev/null; fi printf "\e[?25h" local exit_code="$?" local line_number="$1" diff --git a/misc/alpine-install.func b/misc/alpine-install.func index 7c7b5a3..f9059f9 100644 --- a/misc/alpine-install.func +++ b/misc/alpine-install.func @@ -37,7 +37,6 @@ verb_ip6() { # This function catches errors and handles them with the error handler function catch_errors() { - unset SPINNER_PID set -Eeuo pipefail trap 'error_handler $LINENO "$BASH_COMMAND"' ERR } @@ -49,7 +48,6 @@ error_handler() { local command="$2" local error_message="${RD}[ERROR]${CL} in line ${RD}$line_number${CL}: exit code ${RD}$exit_code${CL}: while executing command ${YW}$command${CL}" echo -e "\n$error_message\n" - [[ -n "${SPINNER_PID:-}" ]] && kill "$SPINNER_PID" &>/dev/null || true } # This function sets up the Container OS by generating the locale, setting the timezone, and checking the network connection diff --git a/misc/build.func b/misc/build.func index d6bf61a..30e1525 100644 --- a/misc/build.func +++ b/misc/build.func @@ -35,7 +35,6 @@ catch_errors() { # This function is called when an error occurs. It receives the exit code, line number, and command that caused the error, and displays an error message. error_handler() { source /dev/stdin <<<$(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVED/main/misc/api.func) - if [ -n "$SPINNER_PID" ] && ps -p "$SPINNER_PID" >/dev/null; then kill "$SPINNER_PID" >/dev/null; fi printf "\e[?25h" local exit_code="$?" local line_number="$1" @@ -1127,7 +1126,6 @@ start() { exit_script exit fi - SPINNER_PID="" install_script else CHOICE=$(whiptail --backtitle "[dev] Proxmox VE Helper Scripts" --title "${APP} LXC Update/Setting" --menu \ @@ -1152,8 +1150,6 @@ start() { exit ;; esac - - SPINNER_PID="" update_script fi } diff --git a/misc/install.func b/misc/install.func index 287bda9..120bc65 100644 --- a/misc/install.func +++ b/misc/install.func @@ -46,14 +46,12 @@ catch_errors() { # This function handles errors error_handler() { source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/api.func) - if [ -n "$SPINNER_PID" ] && ps -p "$SPINNER_PID" >/dev/null; then kill "$SPINNER_PID" >/dev/null; fi printf "\e[?25h" local exit_code="$?" local line_number="$1" local command="$2" local error_message="${RD}[ERROR]${CL} in line ${RD}$line_number${CL}: exit code ${RD}$exit_code${CL}: while executing command ${YW}$command${CL}" echo -e "\n$error_message" - [[ -n "${SPINNER_PID:-}" ]] && kill "$SPINNER_PID" &>/dev/null || true if [[ "$line_number" -eq 50 ]]; then echo -e "The silent function has suppressed the error, run the script with verbose mode enabled, which will provide more detailed output.\n"