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

Merge pull request #2159 from pi-hole/tweak/removeDnsmasqRefs

Tweak/remove dnsmasq refs
This commit is contained in:
Mark Drobnak 2018-04-30 19:26:59 -04:00 committed by GitHub
commit c102d359f8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1853,23 +1853,20 @@ FTLinstall() {
popd > /dev/null || { echo "Unable to return to original directory after FTL binary download."; return 1; } popd > /dev/null || { echo "Unable to return to original directory after FTL binary download."; return 1; }
# Install the FTL service # Install the FTL service
echo -e "${OVER} ${TICK} ${str}" echo -e "${OVER} ${TICK} ${str}"
# If the --resolver flag returns True (exit code 0), then we can safely stop & disable dnsmasq # dnsmasq can now be stopped and disabled
if pihole-FTL --resolver > /dev/null; then if check_service_active "dnsmasq";then
if which dnsmasq > /dev/null; then echo " ${INFO} FTL can now resolve DNS Queries without dnsmasq running separately"
if check_service_active "dnsmasq";then stop_service dnsmasq
echo " ${INFO} FTL can now resolve DNS Queries without dnsmasq running separately" disable_service dnsmasq
stop_service dnsmasq
disable_service dnsmasq
fi
fi
#ensure /etc/dnsmasq.conf contains `conf-dir=/etc/dnsmasq.d`
confdir="conf-dir=/etc/dnsmasq.d"
conffile="/etc/dnsmasq.conf"
if ! grep -q "$confdir" "$conffile"; then
echo "$confdir" >> "$conffile"
fi
fi fi
#ensure /etc/dnsmasq.conf contains `conf-dir=/etc/dnsmasq.d`
confdir="conf-dir=/etc/dnsmasq.d"
conffile="/etc/dnsmasq.conf"
if ! grep -q "$confdir" "$conffile"; then
echo "$confdir" >> "$conffile"
fi
return 0 return 0
# Otherwise, # Otherwise,
else else
@ -1974,6 +1971,11 @@ FTLcheckUpdate()
local remoteSha1 local remoteSha1
local localSha1 local localSha1
# if dnsmasq is running at this point, force reinstall of FTL Binary
if check_service_active "dnsmasq";then
return 0
fi
if [[ ! "${ftlBranch}" == "master" ]]; then if [[ ! "${ftlBranch}" == "master" ]]; then
if [[ ${ftlLoc} ]]; then if [[ ${ftlLoc} ]]; then
# We already have a pihole-FTL binary downloaded. # We already have a pihole-FTL binary downloaded.
@ -2197,11 +2199,6 @@ main() {
echo -e " ${INFO} Restarting services..." echo -e " ${INFO} Restarting services..."
# Start services # Start services
# Only start and enable dnsmasq if FTL does not have the --resolver switch
if ! pihole-FTL --resolver > /dev/null; then
start_service dnsmasq
enable_service dnsmasq
fi
# If the Web server was installed, # If the Web server was installed,
if [[ "${INSTALL_WEB_SERVER}" == true ]]; then if [[ "${INSTALL_WEB_SERVER}" == true ]]; then