From eec14be10d622c6dd33a065ec711f08ad88b8390 Mon Sep 17 00:00:00 2001 From: Promofaux Date: Sun, 24 Jan 2016 21:19:23 +0000 Subject: [PATCH] add $SUDO into spinner control. --- automated install/basic-install.sh | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/automated install/basic-install.sh b/automated install/basic-install.sh index 4ba1620a..d9e448a9 100755 --- a/automated install/basic-install.sh +++ b/automated install/basic-install.sh @@ -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!"