Merge branch 'development' into uninstall_compat_check

# Conflicts:
#	automated install/uninstall.sh
This commit is contained in:
Mcat12 2018-05-30 22:08:20 -04:00
commit 34f5db9ed4
No known key found for this signature in database
GPG key ID: ABB8FC9789AF524D
6 changed files with 49 additions and 44 deletions

View file

@ -1933,11 +1933,13 @@ FTLinstall() {
popd > /dev/null || { echo "Unable to return to original directory after FTL binary download."; return 1; }
# Install the FTL service
echo -e "${OVER} ${TICK} ${str}"
# dnsmasq can now be stopped and disabled
if check_service_active "dnsmasq";then
echo " ${INFO} FTL can now resolve DNS Queries without dnsmasq running separately"
stop_service dnsmasq
disable_service dnsmasq
# dnsmasq can now be stopped and disabled if it exists
if which dnsmasq > /dev/null; then
if check_service_active "dnsmasq";then
echo " ${INFO} FTL can now resolve DNS Queries without dnsmasq running separately"
stop_service dnsmasq
disable_service dnsmasq
fi
fi
#ensure /etc/dnsmasq.conf contains `conf-dir=/etc/dnsmasq.d`
@ -2051,9 +2053,11 @@ FTLcheckUpdate()
local remoteSha1
local localSha1
# if dnsmasq is running at this point, force reinstall of FTL Binary
if check_service_active "dnsmasq";then
return 0
# if dnsmasq exists and is running at this point, force reinstall of FTL Binary
if which dnsmasq > /dev/null; then
if check_service_active "dnsmasq";then
return 0
fi
fi
if [[ ! "${ftlBranch}" == "master" ]]; then

View file

@ -59,19 +59,12 @@ if [ -x "$(command -v apt-get)" ]; then
package_check() {
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
}
elif [ -x "$(command -v rpm)" ]; then
# Fedora Family
PKG_REMOVE="${PKG_MANAGER} remove -y"
package_check() {
rpm -qa | grep "^$1-" > /dev/null
}
package_cleanup() {
"${SUDO} ${PKG_MANAGER}" -y autoremove
}
else
echo -e " ${CROSS} OS distribution not supported"
exit 1
@ -100,14 +93,9 @@ removeAndPurge() {
done
# 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"
# 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
removeNoPurge
}