Update haos-vm.sh

Spinner update
This commit is contained in:
tteckster 2024-04-22 06:38:43 -04:00 committed by GitHub
parent 67cad1583b
commit c042b7c527
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 10 additions and 8 deletions

View File

@ -33,7 +33,7 @@ GN=$(echo "\033[1;92m")
DGN=$(echo "\033[32m") DGN=$(echo "\033[32m")
CL=$(echo "\033[m") CL=$(echo "\033[m")
BFR="\\r\\033[K" BFR="\\r\\033[K"
HOLD="-" HOLD=" "
CM="${GN}${CL}" CM="${GN}${CL}"
CROSS="${RD}${CL}" CROSS="${RD}${CL}"
THIN="discard=on,ssd=1," THIN="discard=on,ssd=1,"
@ -74,13 +74,13 @@ else
fi fi
function spinner() { function spinner() {
printf "\e[?25l" local chars="/-\|"
spinner="◐◓◑◒" local spin_i=0
spin_i=0 printf "\e[?25l"
while true; do while true; do
printf "\b%s" "${spinner:spin_i++%${#spinner}:1}" printf "\r \e[36m%s\e[0m" "${chars:spin_i++%${#chars}:1}"
sleep 0.1 sleep 0.1
done done
} }
function msg_info() { function msg_info() {
@ -396,6 +396,8 @@ elif [ $((${#STORAGE_MENU[@]} / 3)) -eq 1 ]; then
STORAGE=${STORAGE_MENU[0]} STORAGE=${STORAGE_MENU[0]}
else else
while [ -z "${STORAGE:+x}" ]; do while [ -z "${STORAGE:+x}" ]; do
if [ -n "$SPINNER_PID" ] && ps -p $SPINNER_PID > /dev/null; then kill $SPINNER_PID > /dev/null; fi
printf "\e[?25h"
STORAGE=$(whiptail --backtitle "Proxmox VE Helper Scripts" --title "Storage Pools" --radiolist \ STORAGE=$(whiptail --backtitle "Proxmox VE Helper Scripts" --title "Storage Pools" --radiolist \
"Which storage pool you would like to use for ${HN}?\nTo make a selection, use the Spacebar.\n" \ "Which storage pool you would like to use for ${HN}?\nTo make a selection, use the Spacebar.\n" \
16 $(($MSG_MAX_LENGTH + 23)) 6 \ 16 $(($MSG_MAX_LENGTH + 23)) 6 \