dnsmasq.sh: Support resolvconf

Signed-off-by: Tobias Knöppler <6317548+theCalcaholic@users.noreply.github.com>
This commit is contained in:
Tobias Knöppler 2024-04-14 12:55:46 +02:00
parent 0e877ac385
commit c1d2b1fe95
No known key found for this signature in database
GPG Key ID: 3510056072886A8F

View File

@ -19,18 +19,25 @@ install()
[[ $rc -eq 3 ]] && ! [[ "$INIT_SYSTEM" =~ ^("chroot"|"unknown")$ ]] && {
echo "Applying workaround for dnsmasq bug (compare issue #1446)"
mkdir -p /etc/systemd/resolved.conf.d
cat <<EOF > /etc/systemd/resolved.conf.d/nostublistener.conf
if systemctl status systemd-resolved
then
cat <<EOF > /etc/systemd/resolved.conf.d/nostublistener.conf
[Resolve]
DNSStubListener=no
EOF
[[ "$INIT_SYSTEM" != "systemd" ]] || systemctl restart systemd-resolved
[[ "$INIT_SYSTEM" != "systemd" ]] || systemctl restart systemd-resolved
else
systemctl stop resolvconf
systemctl start dnsmasq
systemctl status dnsmasq
fi
# service systemd-resolved stop || true
service dnsmasq start
service dnsmasq status
systemctl start dnsmasq
systemctl status dnsmasq
}
service dnsmasq stop
[[ "$INIT_SYSTEM" != "systemd" ]] || service systemd-resolved start
[[ "$INIT_SYSTEM" != "systemd" ]] || systemctl start systemd-resolved || systemctl start resolvconf
update-rc.d dnsmasq disable || rm /etc/systemd/system/multi-user.target.wants/dnsmasq.service
return 0