mirror of
https://github.com/pi-hole/pi-hole.git
synced 2024-11-15 02:42:58 +00:00
user-facing messages
Signed-off-by: Rob Gill <rrobgill@protonmail.com>
This commit is contained in:
parent
15f0ba839f
commit
8cfe89604a
1 changed files with 9 additions and 2 deletions
|
@ -1266,21 +1266,28 @@ check_service_active() {
|
||||||
}
|
}
|
||||||
|
|
||||||
# Systemd-resolved's DNSStubListener and dnsmasq can't share port 53.
|
# Systemd-resolved's DNSStubListener and dnsmasq can't share port 53.
|
||||||
# Resolved needs to remain in place for installer to download needed files
|
# Resolved needs to remain in place for installer to download needed files,
|
||||||
# so this change needs to be made after installation is complete, but before resarting dnsmasq/ftl
|
# so this change needs to be made after installation is complete, but before resarting dnsmasq/ftl
|
||||||
disable_resolved_stublistener() {
|
disable_resolved_stublistener() {
|
||||||
|
echo -en " ${INFO} Testing if systemd-resolved is enabled"
|
||||||
# Check if Systemd-resolved's DNSStubListener is enabled and active on port 53
|
# Check if Systemd-resolved's DNSStubListener is enabled and active on port 53
|
||||||
if check_service_active "systemd-resolved"; then
|
if check_service_active "systemd-resolved"; then
|
||||||
# Check if DNSStubListener is enabled
|
# Check if DNSStubListener is enabled
|
||||||
|
echo -en " ${OVER} ${INFO} Testing if systemd-resolved DNSStub-Listener is active"
|
||||||
if ( grep -E '#?DNSStubListener=yes' /etc/systemd/resolved.conf &> /dev/null ); then
|
if ( grep -E '#?DNSStubListener=yes' /etc/systemd/resolved.conf &> /dev/null ); then
|
||||||
# Disable the DNSStubListener to unbind it from port 53
|
# Disable the DNSStubListener to unbind it from port 53
|
||||||
# Note that this breaks dns functionality on host until dnsmasq/ftl are up and running
|
# Note that this breaks dns functionality on host until dnsmasq/ftl are up and running
|
||||||
echo -e "Disabling systemd-resolved DNSStubListener"
|
echo -en "${OVER} ${TICK} Disabling systemd-resolved DNSStubListener"
|
||||||
# Make a backup of the original /etc/systemd/resolved.conf
|
# Make a backup of the original /etc/systemd/resolved.conf
|
||||||
# (This will need to be restored on uninstallation)
|
# (This will need to be restored on uninstallation)
|
||||||
sed -r -i.orig 's/#?DNSStubListener=yes/DNSStubListener=no/g' /etc/systemd/resolved.conf
|
sed -r -i.orig 's/#?DNSStubListener=yes/DNSStubListener=no/g' /etc/systemd/resolved.conf
|
||||||
|
echo -e " and restarting systemd-resolved"
|
||||||
systemctl reload-or-restart systemd-resolved
|
systemctl reload-or-restart systemd-resolved
|
||||||
|
else
|
||||||
|
echo -e "${OVER} ${INFO} Systemd-resolved does not need to be restarted"
|
||||||
fi
|
fi
|
||||||
|
else
|
||||||
|
echo -e "${OVER} ${INFO} Systemd-resolved is not enabled"
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue