mirror of
https://github.com/pi-hole/pi-hole.git
synced 2024-11-15 02:42:58 +00:00
add $SUDO into spinner control.
This commit is contained in:
parent
c179936b54
commit
eec14be10d
1 changed files with 2 additions and 4 deletions
|
@ -70,12 +70,10 @@ fi
|
|||
###All credit for the below function goes to http://fitnr.com/showing-a-bash-spinner.html
|
||||
spinner(){
|
||||
local pid=$1
|
||||
local delay=0.001
|
||||
local spinstr='/-\|'
|
||||
|
||||
spin='-\|/'
|
||||
i=0
|
||||
while kill -0 $pid 2>/dev/null
|
||||
while $SUDO kill -0 $pid 2>/dev/null
|
||||
do
|
||||
i=$(( (i+1) %4 ))
|
||||
printf "\b${spin:$i:1}"
|
||||
|
@ -324,7 +322,7 @@ checkForDependencies(){
|
|||
echo -n "::: Checking for $i..."
|
||||
if [ $(dpkg-query -W -f='${Status}' $i 2>/dev/null | grep -c "ok installed") -eq 0 ]; then
|
||||
echo -n " Not found! Installing...."
|
||||
$SUDO apt-get -y -qq install $i > /dev/null & spinner $!
|
||||
$SUDO apt-get -y -qq install $i > /dev/null & spinner $!
|
||||
echo " done!"
|
||||
else
|
||||
echo " already installed!"
|
||||
|
|
Loading…
Reference in a new issue