mirror of
https://github.com/pi-hole/pi-hole.git
synced 2024-11-15 02:42:58 +00:00
New spinner for gravity.sh
Spinner in gravity.sh now matches basic-install.sh and uninstall.sh
This commit is contained in:
parent
32dd594f06
commit
86dd4dd784
1 changed files with 13 additions and 12 deletions
21
gravity.sh
21
gravity.sh
|
@ -75,18 +75,19 @@ if [[ -r $piholeDir/pihole.conf ]];then
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
spinner(){
|
spinner()
|
||||||
|
{
|
||||||
local pid=$1
|
local pid=$1
|
||||||
|
local delay=0.50
|
||||||
spin='-\|/'
|
local spinstr='|/-\'
|
||||||
i=0
|
while [ "$(ps a | awk '{print $1}' | grep "$pid")" ]; do
|
||||||
while $SUDO kill -0 "$pid" 2>/dev/null
|
local temp=${spinstr#?}
|
||||||
do
|
printf " [%c] " "$spinstr"
|
||||||
i=$(( (i+1) %4 ))
|
local spinstr=$temp${spinstr%"$temp"}
|
||||||
printf "\b%s" "${spin:$i:1}"
|
sleep $delay
|
||||||
sleep .1
|
printf "\b\b\b\b\b\b"
|
||||||
done
|
done
|
||||||
printf "\b"
|
printf " \b\b\b\b"
|
||||||
}
|
}
|
||||||
|
|
||||||
###########################
|
###########################
|
||||||
|
|
Loading…
Reference in a new issue