mirror of
https://github.com/nextcloud/nextcloudpi.git
synced 2026-01-10 15:12:01 -03:30
dnsmasq.sh: Fix dns resolv workaround for hosts using resolvconf instead of systemd-resolved
Signed-off-by: Tobias Knöppler <6317548+theCalcaholic@users.noreply.github.com> Signed-off-by: Tobias K <6317548+theCalcaholic@users.noreply.github.com>
This commit is contained in:
parent
78039d38d1
commit
f58852ea27
@ -16,38 +16,30 @@ install()
|
||||
apt-get install --no-install-recommends -y dnsmasq
|
||||
rc=0
|
||||
service dnsmasq status > /dev/null 2>&1 || rc=$?
|
||||
! is_docker && [[ $rc -eq 3 ]] && ! [[ "$INIT_SYSTEM" =~ ^("chroot"|"unknown")$ ]] && {
|
||||
[[ $rc -eq 3 ]] && ! [[ "$INIT_SYSTEM" =~ ^("chroot"|"unknown")$ ]] && command -v systemd-resolve > /dev/null || {
|
||||
echo "Applying workaround for dnsmasq bug (compare issue #1446)"
|
||||
service systemd-resolved stop || true
|
||||
service dnsmasq start
|
||||
service dnsmasq status
|
||||
mkdir -p /etc/systemd/resolved.conf.d
|
||||
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
|
||||
else
|
||||
systemctl stop resolvconf
|
||||
systemctl start dnsmasq
|
||||
systemctl status dnsmasq
|
||||
fi
|
||||
# service systemd-resolved stop || true
|
||||
systemctl start dnsmasq
|
||||
systemctl status dnsmasq
|
||||
}
|
||||
|
||||
service dnsmasq stop
|
||||
[[ "$INIT_SYSTEM" == "systemd" ]] && service systemd-resolved start || true
|
||||
[[ "$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
|
||||
|
||||
[[ "$DOCKERBUILD" == 1 ]] && {
|
||||
cat > /etc/services-available.d/100dnsmasq <<EOF
|
||||
#!/bin/bash
|
||||
|
||||
source /usr/local/etc/library.sh
|
||||
|
||||
[[ "\$1" == "stop" ]] && {
|
||||
echo "stopping dnsmasq..."
|
||||
service dnsmasq stop
|
||||
exit 0
|
||||
}
|
||||
|
||||
persistent_cfg /etc/dnsmasq.conf
|
||||
|
||||
echo "Starting dnsmasq..."
|
||||
service dnsmasq start
|
||||
|
||||
exit 0
|
||||
EOF
|
||||
chmod +x /etc/services-available.d/100dnsmasq
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user