From: "cron2 (Code Review)" Date: Tue, 19 Aug 2025 10:51:58 +0000 In-Reply-To: References: Reply-To: gert@...1296..., arne-openvpn@...1227..., heiko@...515..., openvpn-devel@lists.sourceforge.net, frank@...2641... Message-ID: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Disposition: inline Content-Type: multipart/alternative; boundary="tAGj9fRxaK8="; charset=UTF-8 Subject: [Openvpn-devel] [XS] Change in openvpn[master]: dns: fix systemd dns-updown script List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: d12fk , plaisthos , flichtenheld Cc: openvpn-devel --tAGj9fRxaK8= Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable cron2 has uploaded a new patch set (#2) to the change originally created by= d12fk. ( http://gerrit.openvpn.net/c/openvpn/+/1144?usp=3Demail ) The following approvals got outdated and were removed: Code-Review+2 by flichtenheld Change subject: dns: fix systemd dns-updown script ...................................................................... dns: fix systemd dns-updown script In the resolvconf part of the script there was one instance of a dynamic variable using _* left. The _* ones do not work as the regular ones, but only when you directly place them within ${!}, not indirectly using a variable. Convert the code to use a loop and a check, like in all the other places in the script. Change-Id: Id800cad0e92e0abc0d96079fdb5a9d57578e1446 Signed-off-by: Heiko Hund Acked-by: Frank Lichtenheld Message-Id: <20250818164608.39836-1-frank@...2641...> URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg32= 621.html Signed-off-by: Gert Doering --- M distro/dns-scripts/systemd-dns-updown.sh 1 file changed, 5 insertions(+), 3 deletions(-) git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/44/1144/2 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+=3D"${!domain_var} " done { + local i=3D1 local maxns=3D3 - local server_var=3Ddns_server_${n}_address_* - for addr_var in ${!server_var}; do - [ $((maxns--)) -gt 0 ] || break + while [ "${i}" -le "${maxns}" ]; do + local addr_var=3Ddns_server_${n}_address_${i} + [ -n "${!addr_var}" ] || break echo "nameserver ${!addr_var}" + i=3D$((i+1)) done [ -z "$domains" ] || echo "search $domains" } | /sbin/resolvconf -a "$dev" -- To view, visit http://gerrit.openvpn.net/c/openvpn/+/1144?usp=3Demail To unsubscribe, or for help writing mail filters, visit http://gerrit.openv= pn.net/settings Gerrit-Project: openvpn Gerrit-Branch: master Gerrit-Change-Id: Id800cad0e92e0abc0d96079fdb5a9d57578e1446 Gerrit-Change-Number: 1144 Gerrit-PatchSet: 2 Gerrit-Owner: d12fk Gerrit-Reviewer: flichtenheld Gerrit-Reviewer: plaisthos Gerrit-CC: openvpn-devel Gerrit-MessageType: newpatchset --tAGj9fRxaK8= Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable

cron2 uploaded patch set #2 to the change originally cr= eated by d12fk.

View Change

The following approvals got outdated an= d were removed: Code-Review+2 by flichtenheld

dns: fix systemd dns-updown script

In = the resolvconf part of the script there was one instance of a dynamic
va= riable using _* left. The _* ones do not work as the regular ones, but
o= nly when you directly place them within ${!}, not indirectly using a
var= iable.

Convert the code to use a loop and a check, like in all the o= ther places
in the script.

Change-Id: Id800cad0e92e0abc0d96079fdb= 5a9d57578e1446
Signed-off-by: Heiko Hund <heiko@...2662...>
Ack= ed-by: Frank Lichtenheld <frank@...2641...>
Message-Id: <202508= 18164608.39836-1-frank@...2641...>
URL: https://www.mail-archive.com/= openvpn-devel@lists.sourceforge.net/msg32621.html
Signed-off-by: Gert Do= ering <gert@...1296...>
---
M distro/dns-scripts/systemd-dns-up= down.sh
1 file changed, 5 insertions(+), 3 deletions(-)

git pu= ll ssh://gerrit.openvpn.net:29418/openvpn refs/changes/44/1144/2
di=
ff --git a/distro/dns-scripts/systemd-dns-updown.sh b/distro/dns-scripts/sy=
stemd-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,1= 3 @@
domains+=3D"${!domain_var} "
done
{
+ local i=3D1
= local maxns=3D3
- local server_var=3Ddns_server_${n}_address_*
<= span style=3D"color: hsl(0, 100%, 40%);">- for addr_var in ${!se= rver_var}; do

- = [ $((maxns--)) -gt 0 ] || break
+ while [ "${i}" -le "${maxns}= " ]; do
+ = local addr_var=3Ddns_server_${n}_address_${i}
+ [ -n "${!addr_var}&= quot; ] || break
echo "nameserver ${!= addr_var}"
+ = i=3D$((i+1))
done
= [ -z "$domains" ] || echo "search $domains"= ;
} | /sbin/resolvconf -a "$dev"<= br>

To view, visit change 1144. To unsubscribe, or for= help writing mail filters, visit settings.

Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: Id800cad0e92e0abc0d96079fdb5= a9d57578e1446
Gerrit-Change-Number: 1144
Gerrit-PatchSet: 2
Gerrit-Owner: d12fk <heiko@...515...>
Gerrit-Reviewer: flichtenheld <frank@...2716...= 1...>
Gerrit-Reviewer: plaisthos <arne-openvpn@...1186...= .1227...>
Gerrit-CC: openvpn-devel <openvpn-devel@...1484...= ts.sourceforge.net>
Gerrit-MessageType: newpatchset
--tAGj9fRxaK8=--