mirror of
https://github.com/pi-hole/pi-hole.git
synced 2024-11-15 02:42:58 +00:00
remove package_check to avoid situations like #1760
Signed-off-by: Adam Warner <adamw@rner.email>
This commit is contained in:
parent
9631519eb1
commit
2c8dcd86e5
1 changed files with 1 additions and 13 deletions
|
@ -62,19 +62,12 @@ if [ -x "$(command -v rpm)" ]; then
|
||||||
package_check() {
|
package_check() {
|
||||||
rpm -qa | grep ^$1- > /dev/null
|
rpm -qa | grep ^$1- > /dev/null
|
||||||
}
|
}
|
||||||
package_cleanup() {
|
|
||||||
${SUDO} ${PKG_MANAGER} -y autoremove
|
|
||||||
}
|
|
||||||
elif [ -x "$(command -v apt-get)" ]; then
|
elif [ -x "$(command -v apt-get)" ]; then
|
||||||
# Debian Family
|
# Debian Family
|
||||||
PKG_REMOVE="${PKG_MANAGER} -y remove --purge"
|
PKG_REMOVE="${PKG_MANAGER} -y remove --purge"
|
||||||
package_check() {
|
package_check() {
|
||||||
dpkg-query -W -f='${Status}' "$1" 2>/dev/null | grep -c "ok installed"
|
dpkg-query -W -f='${Status}' "$1" 2>/dev/null | grep -c "ok installed"
|
||||||
}
|
}
|
||||||
package_cleanup() {
|
|
||||||
${SUDO} ${PKG_MANAGER} -y autoremove
|
|
||||||
${SUDO} ${PKG_MANAGER} -y autoclean
|
|
||||||
}
|
|
||||||
else
|
else
|
||||||
echo -e " ${CROSS} OS distribution not supported"
|
echo -e " ${CROSS} OS distribution not supported"
|
||||||
exit 1
|
exit 1
|
||||||
|
@ -103,14 +96,9 @@ removeAndPurge() {
|
||||||
done
|
done
|
||||||
|
|
||||||
# Remove dnsmasq config files
|
# Remove dnsmasq config files
|
||||||
${SUDO} rm -f /etc/dnsmasq.conf /etc/dnsmasq.conf.orig /etc/dnsmasq.d/01-pihole.conf &> /dev/null
|
${SUDO} rm -f /etc/dnsmasq.conf /etc/dnsmasq.conf.orig /etc/dnsmasq.d/*-pihole*.conf &> /dev/null
|
||||||
echo -e " ${TICK} Removing dnsmasq config files"
|
echo -e " ${TICK} Removing dnsmasq config files"
|
||||||
|
|
||||||
# Take care of any additional package cleaning
|
|
||||||
echo -ne " ${INFO} Removing & cleaning remaining dependencies..."
|
|
||||||
package_cleanup &> /dev/null
|
|
||||||
echo -e "${OVER} ${TICK} Removed & cleaned up remaining dependencies"
|
|
||||||
|
|
||||||
# Call removeNoPurge to remove Pi-hole specific files
|
# Call removeNoPurge to remove Pi-hole specific files
|
||||||
removeNoPurge
|
removeNoPurge
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue