From 33ef8aadbeb7df8b09319472cdcc272cab7ea8dd Mon Sep 17 00:00:00 2001 From: Michel Roegl-Brunner <73236783+michelroegl-brunner@users.noreply.github.com> Date: Mon, 10 Feb 2025 11:14:24 +0100 Subject: [PATCH] Prevent double spinner (#2203) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Rögl-Brunner Michel --- ct/create_lxc.sh | 1 + misc/build.func | 1 + misc/install.func | 1 + 3 files changed, 3 insertions(+) diff --git a/ct/create_lxc.sh b/ct/create_lxc.sh index a62fd2d01..df35a03bc 100644 --- a/ct/create_lxc.sh +++ b/ct/create_lxc.sh @@ -64,6 +64,7 @@ function spinner() { # This function displays an informational message with a yellow color. function msg_info() { + if [ -n "$SPINNER_PID" ] && ps -p $SPINNER_PID > /dev/null; then kill $SPINNER_PID > /dev/null; fi local msg="$1" echo -ne "${TAB}${YW}${HOLD}${msg}${HOLD}" spinner & diff --git a/misc/build.func b/misc/build.func index 86f01b2f4..1800bdc2b 100644 --- a/misc/build.func +++ b/misc/build.func @@ -98,6 +98,7 @@ spinner() { # This function displays an informational message with a yellow color. msg_info() { + if [ -n "$SPINNER_PID" ] && ps -p $SPINNER_PID > /dev/null; then kill $SPINNER_PID > /dev/null; fi local msg="$1" echo -ne "${TAB}${YW}${HOLD}${msg}${HOLD}" spinner & diff --git a/misc/install.func b/misc/install.func index b02344797..5087510cd 100644 --- a/misc/install.func +++ b/misc/install.func @@ -90,6 +90,7 @@ spinner() { # This function displays an informational message with a yellow color. msg_info() { + if [ -n "$SPINNER_PID" ] && ps -p $SPINNER_PID > /dev/null; then kill $SPINNER_PID > /dev/null; fi local msg="$1" echo -ne "${TAB}${YW}${HOLD}${msg}${HOLD}" spinner &