1
0
mirror of https://github.com/pi-hole/pi-hole synced 2024-10-18 22:09:04 +00:00

Merge pull request #2167 from pi-hole/uninstall_compat_check

flip uninstall compatability check
This commit is contained in:
Mark Drobnak 2018-05-30 22:13:21 -04:00 committed by GitHub
commit 23a7feeb6e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -53,18 +53,18 @@ if [[ "${INSTALL_WEB_SERVER}" == true ]]; then
fi
# Compatability
if [ -x "$(command -v rpm)" ]; then
# Fedora Family
PKG_REMOVE="${PKG_MANAGER} remove -y"
package_check() {
rpm -qa | grep ^$1- > /dev/null
}
elif [ -x "$(command -v apt-get)" ]; then
if [ -x "$(command -v apt-get)" ]; then
# Debian Family
PKG_REMOVE="${PKG_MANAGER} -y remove --purge"
package_check() {
dpkg-query -W -f='${Status}' "$1" 2>/dev/null | grep -c "ok installed"
}
elif [ -x "$(command -v rpm)" ]; then
# Fedora Family
PKG_REMOVE="${PKG_MANAGER} remove -y"
package_check() {
rpm -qa | grep "^$1-" > /dev/null
}
else
echo -e " ${CROSS} OS distribution not supported"
exit 1