Consistency

Now with block indents!
This commit is contained in:
Marcus Hildum 2016-10-21 23:23:31 -07:00
parent 640398ced4
commit 7ebaf8e843
1 changed files with 28 additions and 28 deletions

View File

@ -11,7 +11,7 @@
# (at your option) any later version.
# Must be root to uninstall
if [[ $EUID -eq 0 ]];then
if [[ ${EUID} -eq 0 ]]; then
echo "::: You are root."
else
echo "::: Sudo will be used for the uninstall."
@ -33,7 +33,7 @@ if [ -x "$(command -v rpm)" ];then
else
PKG_MANAGER="yum"
fi
PKG_REMOVE="$PKG_MANAGER remove -y"
PKG_REMOVE="${PKG_MANAGER} remove -y"
PIHOLE_DEPS=( bind-utils bc dnsmasq lighttpd lighttpd-fastcgi php-common git curl unzip wget findutils )
package_check() {
rpm -qa | grep ^$1- > /dev/null
@ -44,7 +44,7 @@ if [ -x "$(command -v rpm)" ];then
elif [ -x "$(command -v apt-get)" ]; then
# Debian Family
PKG_MANAGER="apt-get"
PKG_REMOVE="$PKG_MANAGER -y remove --purge"
PKG_REMOVE="${PKG_MANAGER} -y remove --purge"
PIHOLE_DEPS=( dnsutils bc dnsmasq lighttpd php5-common git curl unzip wget )
package_check() {
dpkg-query -W -f='${Status}' "$1" 2>/dev/null | grep -c "ok installed"
@ -62,10 +62,10 @@ spinner() {
local pid=$1
local delay=0.50
local spinstr='/-\|'
while [ "$(ps a | awk '{print $1}' | grep "$pid")" ]; do
while [ "$(ps a | awk '{print $1}' | grep "${pid}")" ]; do
local temp=${spinstr#?}
printf " [%c] " "$spinstr"
local spinstr=${temp}${spinstr%"$temp"}
printf " [%c] " "${spinstr}"
local spinstr=${temp}${spinstr%"${temp}"}
sleep ${delay}
printf "\b\b\b\b\b\b"
done
@ -79,15 +79,15 @@ removeAndPurge() {
package_check ${i} > /dev/null
if [ $? -eq 0 ]; then
while true; do
read -rp "::: Do you wish to remove $i from your system? [y/n]: " yn
read -rp "::: Do you wish to remove ${i} from your system? [y/n]: " yn
case ${yn} in
[Yy]* ) printf ":::\tRemoving %s..." "$i"; ${SUDO} ${PKG_REMOVE} "$i" &> /dev/null & spinner $!; printf "done!\n"; break;;
[Nn]* ) printf ":::\tSkipping %s" "$i\n"; break;;
[Yy]* ) printf ":::\tRemoving %s..." "${i}"; ${SUDO} ${PKG_REMOVE} "${i}" &> /dev/null & spinner $!; printf "done!\n"; break;;
[Nn]* ) printf ":::\tSkipping %s" "${i}\n"; break;;
* ) printf "::: You must answer yes or no!\n";;
esac
done
else
printf ":::\tPackage %s not installed... Not removing.\n" "$i"
printf ":::\tPackage %s not installed... Not removing.\n" "${i}"
fi
done