mirror of
https://github.com/eworm-de/routeros-scripts.git
synced 2025-08-17 00:01:24 +02:00
netwatch-dns: disable DoH if time not sync...
... as it is possible that time is off, DNS via DoH fails (cert invalid), and finally syncing time fails due to failing DNS.
This commit is contained in:
parent
f952ea73e6
commit
d360cc05be
1 changed files with 8 additions and 0 deletions
|
@ -16,6 +16,8 @@
|
||||||
|
|
||||||
:global CertificateAvailable;
|
:global CertificateAvailable;
|
||||||
:global EitherOr;
|
:global EitherOr;
|
||||||
|
:global IsDNSResolving;
|
||||||
|
:global IsTimeSync;
|
||||||
:global LogPrint;
|
:global LogPrint;
|
||||||
:global ParseKeyValueStore;
|
:global ParseKeyValueStore;
|
||||||
:global ScriptLock;
|
:global ScriptLock;
|
||||||
|
@ -67,6 +69,12 @@
|
||||||
:local DohCurrent [ /ip/dns/get use-doh-server ];
|
:local DohCurrent [ /ip/dns/get use-doh-server ];
|
||||||
:local DohServers ({});
|
:local DohServers ({});
|
||||||
|
|
||||||
|
:if ([ :len $DohCurrent ] > 0 && [ $IsDNSResolving ] = false && [ $IsTimeSync ] = false) do={
|
||||||
|
$LogPrint info $ScriptName ("Time is not sync, disabling DoH: " . $DohCurrent);
|
||||||
|
/ip/dns/set use-doh-server="";
|
||||||
|
:set DohCurrent "";
|
||||||
|
}
|
||||||
|
|
||||||
:foreach Host in=[ /tool/netwatch/find where comment~"\\bdoh\\b" status="up" ] do={
|
:foreach Host in=[ /tool/netwatch/find where comment~"\\bdoh\\b" status="up" ] do={
|
||||||
:local HostVal [ /tool/netwatch/get $Host ];
|
:local HostVal [ /tool/netwatch/get $Host ];
|
||||||
:local HostInfo [ $ParseKeyValueStore ($HostVal->"comment") ];
|
:local HostInfo [ $ParseKeyValueStore ($HostVal->"comment") ];
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue