mirror of
https://github.com/pi-hole/pi-hole
synced 2024-12-22 06:48:07 +00:00
Regex & case fix
grep & sed regexes match commented or uncommented Signed-off-by: Rob Gill <rrobgill@protonmail.com>
This commit is contained in:
parent
25d0e125e5
commit
a431c829cb
@ -1269,16 +1269,16 @@ check_service_active() {
|
||||
# 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
|
||||
disable_resolved_stublistener() {
|
||||
# Check if Systemd-resolved's DNSSTub listener 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
|
||||
# Check if DNSStubListener is enabled
|
||||
if ( grep '#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
|
||||
# Note that this breaks dns functionality on host until dnsmasq/ftl are up and running
|
||||
echo -e "Disabling systemd-resolved DNSStubListener"
|
||||
# Make a backup of the original /etc/systemd/resolved.conf
|
||||
# (This will need to be restored on uninstallation)
|
||||
sed -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
|
||||
systemctl restart systemd-resolved
|
||||
fi
|
||||
fi
|
||||
|
Loading…
Reference in New Issue
Block a user