mirror of
https://github.com/eworm-de/routeros-scripts.git
synced 2024-05-11 05:55:19 +00:00
netwatch-dns: properly check for disabled state
The property 'disabled' can be undefined, which evaluates to enabled - but is not matched by 'disabled=no'.
This commit is contained in:
@ -25,7 +25,7 @@ $ScriptLock $0;
|
|||||||
:local DnsFallback [ :toarray "" ];
|
:local DnsFallback [ :toarray "" ];
|
||||||
:local DnsCurrent [ /ip/dns/get servers ];
|
:local DnsCurrent [ /ip/dns/get servers ];
|
||||||
|
|
||||||
:foreach Host in=[ /tool/netwatch/find where comment~"dns" disabled=no ] do={
|
:foreach Host in=[ /tool/netwatch/find where comment~"dns" !disabled ] do={
|
||||||
:local HostVal [ /tool/netwatch/get $Host ];
|
:local HostVal [ /tool/netwatch/get $Host ];
|
||||||
:local HostInfo [ $ParseKeyValueStore ($HostVal->"comment") ];
|
:local HostInfo [ $ParseKeyValueStore ($HostVal->"comment") ];
|
||||||
|
|
||||||
@ -59,7 +59,7 @@ $ScriptLock $0;
|
|||||||
:local DohServer "";
|
:local DohServer "";
|
||||||
:local DohCurrent [ /ip/dns/get use-doh-server ];
|
:local DohCurrent [ /ip/dns/get use-doh-server ];
|
||||||
|
|
||||||
:foreach Host in=[ /tool/netwatch/find where comment~"doh" disabled=no ] do={
|
:foreach Host in=[ /tool/netwatch/find where comment~"doh" !disabled ] do={
|
||||||
:local HostVal [ /tool/netwatch/get $Host ];
|
:local HostVal [ /tool/netwatch/get $Host ];
|
||||||
:local HostInfo [ $ParseKeyValueStore ($HostVal->"comment") ];
|
:local HostInfo [ $ParseKeyValueStore ($HostVal->"comment") ];
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user