add $SUDO into spinner control.

This commit is contained in:
Promofaux 2016-01-24 21:19:23 +00:00
parent c179936b54
commit eec14be10d

View file

@ -70,12 +70,10 @@ fi
###All credit for the below function goes to http://fitnr.com/showing-a-bash-spinner.html ###All credit for the below function goes to http://fitnr.com/showing-a-bash-spinner.html
spinner(){ spinner(){
local pid=$1 local pid=$1
local delay=0.001
local spinstr='/-\|'
spin='-\|/' spin='-\|/'
i=0 i=0
while kill -0 $pid 2>/dev/null while $SUDO kill -0 $pid 2>/dev/null
do do
i=$(( (i+1) %4 )) i=$(( (i+1) %4 ))
printf "\b${spin:$i:1}" printf "\b${spin:$i:1}"