Update utils.sh

This commit is contained in:
MacRimi
2026-09-11 19:12:56 +02:00
parent b5b128264d
commit 5d73cd4aec
+5 -1
View File
@@ -34,6 +34,10 @@
# ========================================================== # ==========================================================
# Repository and directory structure # Repository and directory structure
# Bound from the start so every `[ -n "$SPINNER_PID" ]` check is safe under
# `set -u`, even in a script that sources this before starting a spinner.
SPINNER_PID=""
LOCAL_SCRIPTS="/usr/local/share/proxmenux/scripts" LOCAL_SCRIPTS="/usr/local/share/proxmenux/scripts"
INSTALL_DIR="/usr/local/bin" INSTALL_DIR="/usr/local/bin"
BASE_DIR="/usr/local/share/proxmenux" BASE_DIR="/usr/local/share/proxmenux"
@@ -126,7 +130,7 @@ msg_info() {
# paired with a msg_ok. Without this its PID is lost when SPINNER_PID is # paired with a msg_ok. Without this its PID is lost when SPINNER_PID is
# overwritten below, leaving an orphan spinner on screen (e.g. behind a # overwritten below, leaving an orphan spinner on screen (e.g. behind a
# whiptail dialog). # whiptail dialog).
if [ -n "$SPINNER_PID" ] && ps -p "$SPINNER_PID" > /dev/null 2>&1; then if [ -n "${SPINNER_PID:-}" ] && ps -p "$SPINNER_PID" > /dev/null 2>&1; then
kill "$SPINNER_PID" > /dev/null 2>&1 kill "$SPINNER_PID" > /dev/null 2>&1
wait "$SPINNER_PID" 2>/dev/null wait "$SPINNER_PID" 2>/dev/null
printf "\r\033[K" printf "\r\033[K"