Tidy up For loops, clean up whitespace

This commit is contained in:
Promofaux 2016-04-03 21:43:36 +01:00
parent 36645d9335
commit 2d08217173

View file

@ -491,11 +491,9 @@ installScripts() {
#Tidy up /usr/local/bin directory if installing over previous install. #Tidy up /usr/local/bin directory if installing over previous install.
oldFiles=( gravity chronometer whitelist blacklist piholeLogFlush updateDashboard uninstall setupLCD piholeDebug) oldFiles=( gravity chronometer whitelist blacklist piholeLogFlush updateDashboard uninstall setupLCD piholeDebug)
for i in "${oldFiles[@]}" for i in "${oldFiles[@]}"; do
do
:
if [ -f "/usr/local/bin/$i.sh" ]; then if [ -f "/usr/local/bin/$i.sh" ]; then
$SUDO rm /usr/local/bin/$i.sh $SUDO rm /usr/local/bin/"$i".sh
fi fi
done done
@ -560,9 +558,7 @@ checkForDependencies() {
echo "::: Checking dependencies:" echo "::: Checking dependencies:"
dependencies=( dnsutils bc toilet figlet dnsmasq lighttpd php5-common php5-cgi php5 git curl unzip wget ) dependencies=( dnsutils bc toilet figlet dnsmasq lighttpd php5-common php5-cgi php5 git curl unzip wget )
for i in "${dependencies[@]}" for i in "${dependencies[@]}"; do
do
:
echo -n "::: Checking for $i..." echo -n "::: Checking for $i..."
if [ "$(dpkg-query -W -f='${Status}' "$i" 2>/dev/null | grep -c "ok installed")" -eq 0 ]; then if [ "$(dpkg-query -W -f='${Status}' "$i" 2>/dev/null | grep -c "ok installed")" -eq 0 ]; then
echo -n " Not found! Installing...." echo -n " Not found! Installing...."