Added /etc/.pihole/ and /var/log/*pihole* to uninstall as well as fixed missing call to removeNoPurge.

This commit is contained in:
Nate 2016-03-26 16:50:05 -05:00 committed by nate
parent 7388461ede
commit 901cb44f5e
2 changed files with 24 additions and 16 deletions

View file

@ -72,19 +72,19 @@ fi
# fi # fi
####### FUNCTIONS ########## ####### FUNCTIONS ##########
###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.75
spin='-\|/' local spinstr='|/-\'
i=0 while [ "$(ps a | awk '{print $1}' | grep $pid)" ]; do
while $SUDO kill -0 "$pid" 2>/dev/null local temp=${spinstr#?}
do printf " [%c] " "$spinstr"
i=$(( (i+1) %4 )) local spinstr=$temp${spinstr%"$temp"}
printf "\b%s" "{$spin:$i:1}" sleep $delay
sleep .1 printf "\b\b\b\b\b\b"
done done
printf "\b" printf " \b\b\b\b"
} }
backupLegacyPihole() { backupLegacyPihole() {

View file

@ -34,7 +34,10 @@ function removeAndPurge {
# Remove dependency config files # Remove dependency config files
echo "Removing dnsmasq config files..." echo "Removing dnsmasq config files..."
$SUDO rm /etc/dnsmasq.conf /etc/dnsmasq.conf.orig &> /dev/null $SUDO rm /etc/dnsmasq.conf /etc/dnsmasq.conf.orig /etc/dnsmasq.d/01-pihole.conf &> /dev/null
# Call removeNoPurge to remove PiHole specific files
removeNoPurge
} }
function removeNoPurge { function removeNoPurge {
@ -45,9 +48,11 @@ function removeNoPurge {
$SUDO rm /var/www/html/index.lighttpd.orig &> /dev/null $SUDO rm /var/www/html/index.lighttpd.orig &> /dev/null
# If the web directory is empty after removing these files, then the parent html folder can be removed. # If the web directory is empty after removing these files, then the parent html folder can be removed.
if [ -d "/var/www/html" ]; then
if [[ ! "$(ls -A /var/www/html)" ]]; then if [[ ! "$(ls -A /var/www/html)" ]]; then
$SUDO rm -rf /var/www/html &> /dev/null $SUDO rm -rf /var/www/html &> /dev/null
fi fi
fi
# Attempt to preserve backwards compatibility with older versions # Attempt to preserve backwards compatibility with older versions
# to guarantee no additional changes were made to /etc/crontab after # to guarantee no additional changes were made to /etc/crontab after
@ -73,7 +78,10 @@ function removeNoPurge {
$SUDO rm /usr/local/bin/chronometer.sh &> /dev/null $SUDO rm /usr/local/bin/chronometer.sh &> /dev/null
$SUDO rm /usr/local/bin/whitelist.sh &> /dev/null $SUDO rm /usr/local/bin/whitelist.sh &> /dev/null
$SUDO rm /usr/local/bin/piholeLogFlush.sh &> /dev/null $SUDO rm /usr/local/bin/piholeLogFlush.sh &> /dev/null
$SUDO rm /usr/local/bin/piholeDebug.sh &> /dev/null
$SUDO rm -rf /var/log/*pihole* &> /dev/null
$SUDO rm -rf /etc/pihole/ &> /dev/null $SUDO rm -rf /etc/pihole/ &> /dev/null
$SUDO rm -rf /etc/.pihole/ &> /dev/null
} }