netwatch-dns: use :toarray's new delimiter= to split cert names

The new delimiter= parameter for :toarray with introduced in
RouterOS 7.21.
This commit is contained in:
Christian Hesse 2026-05-13 16:25:14 +02:00
parent dfdfdd69c2
commit e93422670f
2 changed files with 3 additions and 4 deletions

View file

@ -3,7 +3,7 @@
# Copyright (c) 2022-2026 Christian Hesse <mail@eworm.de>
# https://rsc.eworm.de/COPYING.md
#
# requires RouterOS, version=7.19
# requires RouterOS, version=7.21
# requires device-mode, fetch
#
# monitor and manage dns/doh with netwatch
@ -17,7 +17,6 @@
:local ScriptName [ :jobname ];
:global CertificateAvailable;
:global CharacterReplace;
:global EitherOr;
:global IsDNSResolving;
:global LogPrint;
@ -104,7 +103,7 @@
}
:foreach DohServer in=$DohServers do={
:foreach DohCert in=[ :toarray [ $CharacterReplace ($DohServer->"doh-cert") ":" "," ] ] do={
:foreach DohCert in=[ :toarray delimiter=":" ($DohServer->"doh-cert") ] do={
:if ([ :len $DohCert ] > 0) do={
:if ([ $CertificateAvailable $DohCert "fetch" ] = false || \
[ $CertificateAvailable $DohCert "dns" ] = false) do={