Message ID | 20250818164608.39836-1-frank@lichtenheld.com |
---|---|
State | New |
Headers | show |
Series | [Openvpn-devel,v1] dns: fix systemd dns-updown script | expand |
In addition to the ACK from Frank I tested this on a "Debian Unstable" system, after "apt install resolvconf" gave me a resolvconf binary (and kicked out systemd-resolvconf). Does not work without the patch, with the error message reported by Ralf Hildebrandt on -users, works with the patch. Your patch has been applied to the master branch. commit 72a0e6f94f16a6dcfe2b445758d42dedaba11b92 Author: Heiko Hund Date: Mon Aug 18 18:46:08 2025 +0200 dns: fix systemd dns-updown script Signed-off-by: Heiko Hund <heiko@ist.eigentlich.net> Acked-by: Frank Lichtenheld <frank@lichtenheld.com> Message-Id: <20250818164608.39836-1-frank@lichtenheld.com> URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg32621.html Signed-off-by: Gert Doering <gert@greenie.muc.de> -- kind regards, Gert Doering
diff --git a/distro/dns-scripts/systemd-dns-updown.sh b/distro/dns-scripts/systemd-dns-updown.sh index 9006e28..ed3947a 100644 --- a/distro/dns-scripts/systemd-dns-updown.sh +++ b/distro/dns-scripts/systemd-dns-updown.sh @@ -189,11 +189,13 @@ domains+="${!domain_var} " done { + local i=1 local maxns=3 - local server_var=dns_server_${n}_address_* - for addr_var in ${!server_var}; do - [ $((maxns--)) -gt 0 ] || break + while [ "${i}" -le "${maxns}" ]; do + local addr_var=dns_server_${n}_address_${i} + [ -n "${!addr_var}" ] || break echo "nameserver ${!addr_var}" + i=$((i+1)) done [ -z "$domains" ] || echo "search $domains" } | /sbin/resolvconf -a "$dev"