1
0
mirror of https://github.com/pi-hole/pi-hole synced 2024-12-22 23:08:07 +00:00

Check if lighttpd has been uninstalled before removing conf files

If is still installed, then restore the original lighttpd.conf file.
This commit is contained in:
nate 2016-03-28 17:08:19 -05:00
parent 660e71f032
commit 32dd594f06

View File

@ -107,8 +107,13 @@ function removeNoPurge {
fi fi
echo "::: Removing config files and scripts..." echo "::: Removing config files and scripts..."
$SUDO rm -rf /etc/lighttpd/ &> /dev/null if [ ! "$(dpkg-query -W --showformat='${Status}\n' lighttpd 2> /dev/null | grep -c "ok installed")" -eq 1 ]; then
$SUDO rm /var/log/pihole.log &> /dev/null $SUDO rm -rf /etc/lighttpd/ &> /dev/null
else
if [ -f /etc/lighttpd/lighttpd.conf.orig ]; then
$SUDO mv /etc/lighttpd/lighttpd.conf.orig /etc/lighttpd/lighttpd.conf
fi
fi
$SUDO rm /usr/local/bin/gravity.sh &> /dev/null $SUDO rm /usr/local/bin/gravity.sh &> /dev/null
$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