mirror of
https://github.com/pi-hole/pi-hole
synced 2024-12-22 23:08:07 +00:00
Merge pull request #2167 from pi-hole/uninstall_compat_check
flip uninstall compatability check
This commit is contained in:
commit
23a7feeb6e
@ -53,18 +53,18 @@ if [[ "${INSTALL_WEB_SERVER}" == true ]]; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
# Compatability
|
# Compatability
|
||||||
if [ -x "$(command -v rpm)" ]; then
|
if [ -x "$(command -v apt-get)" ]; then
|
||||||
# Fedora Family
|
|
||||||
PKG_REMOVE="${PKG_MANAGER} remove -y"
|
|
||||||
package_check() {
|
|
||||||
rpm -qa | grep ^$1- > /dev/null
|
|
||||||
}
|
|
||||||
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"
|
||||||
}
|
}
|
||||||
|
elif [ -x "$(command -v rpm)" ]; then
|
||||||
|
# Fedora Family
|
||||||
|
PKG_REMOVE="${PKG_MANAGER} remove -y"
|
||||||
|
package_check() {
|
||||||
|
rpm -qa | grep "^$1-" > /dev/null
|
||||||
|
}
|
||||||
else
|
else
|
||||||
echo -e " ${CROSS} OS distribution not supported"
|
echo -e " ${CROSS} OS distribution not supported"
|
||||||
exit 1
|
exit 1
|
||||||
|
Loading…
Reference in New Issue
Block a user