mirror of
https://github.com/pi-hole/pi-hole.git
synced 2024-11-15 02:42:58 +00:00
switch up dnsmasq detection logic
Signed-off-by: Adam Warner <adamw@rner.email>
This commit is contained in:
parent
8b4198fd8d
commit
68d7337f98
1 changed files with 18 additions and 21 deletions
|
@ -1853,15 +1853,12 @@ 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 which dnsmasq > /dev/null; then
|
|
||||||
if check_service_active "dnsmasq";then
|
if check_service_active "dnsmasq";then
|
||||||
echo " ${INFO} FTL can now resolve DNS Queries without dnsmasq running separately"
|
echo " ${INFO} FTL can now resolve DNS Queries without dnsmasq running separately"
|
||||||
stop_service dnsmasq
|
stop_service dnsmasq
|
||||||
disable_service dnsmasq
|
disable_service dnsmasq
|
||||||
fi
|
fi
|
||||||
fi
|
|
||||||
|
|
||||||
#ensure /etc/dnsmasq.conf contains `conf-dir=/etc/dnsmasq.d`
|
#ensure /etc/dnsmasq.conf contains `conf-dir=/etc/dnsmasq.d`
|
||||||
confdir="conf-dir=/etc/dnsmasq.d"
|
confdir="conf-dir=/etc/dnsmasq.d"
|
||||||
|
@ -1869,7 +1866,7 @@ FTLinstall() {
|
||||||
if ! grep -q "$confdir" "$conffile"; then
|
if ! grep -q "$confdir" "$conffile"; then
|
||||||
echo "$confdir" >> "$conffile"
|
echo "$confdir" >> "$conffile"
|
||||||
fi
|
fi
|
||||||
fi
|
|
||||||
return 0
|
return 0
|
||||||
# Otherwise,
|
# Otherwise,
|
||||||
else
|
else
|
||||||
|
@ -2025,6 +2022,11 @@ FTLdetect() {
|
||||||
echo ""
|
echo ""
|
||||||
echo -e " ${INFO} FTL Checks..."
|
echo -e " ${INFO} FTL Checks..."
|
||||||
|
|
||||||
|
# if dnsmasq is running at this point, force reinstall of FTL Binary
|
||||||
|
if check_service_active "dnsmasq";then
|
||||||
|
FTLinstall "${binary}" || return 1
|
||||||
|
fi
|
||||||
|
|
||||||
if FTLcheckUpdate ; then
|
if FTLcheckUpdate ; then
|
||||||
FTLinstall "${binary}" || return 1
|
FTLinstall "${binary}" || return 1
|
||||||
fi
|
fi
|
||||||
|
@ -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
|
||||||
|
|
Loading…
Reference in a new issue