From bdb7126a38c3dfe40e34de65f0da2621107cc702 Mon Sep 17 00:00:00 2001 From: tteckster Date: Sun, 21 Apr 2024 09:12:55 -0400 Subject: [PATCH] Update create_lxc.sh Spinner update --- ct/create_lxc.sh | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/ct/create_lxc.sh b/ct/create_lxc.sh index 010dffb8..f5218600 100644 --- a/ct/create_lxc.sh +++ b/ct/create_lxc.sh @@ -17,7 +17,7 @@ CL=$(echo "\033[m") CM="${GN}✓${CL}" CROSS="${RD}✗${CL}" BFR="\\r\\033[K" -HOLD="-" +HOLD=" " # This sets error handling options and defines the error_handler function to handle errors set -Eeuo pipefail @@ -36,13 +36,13 @@ function error_handler() { # This function displays a spinner. function spinner() { - printf "\e[?25l" - spinner="/-\\|/-\\|" - spin_i=0 - while true; do - printf "\b%s" "${spinner:spin_i++%${#spinner}:1}" - sleep 0.1 - done + local chars="/-\|" + local spin_i=0 + printf "\e[?25l" + while true; do + printf "\r \e[36m%s\e[0m" "${chars:spin_i++%${#chars}:1}" + sleep 0.1 + done } # This function displays an informational message with a yellow color.