mirror of
https://github.com/eworm-de/routeros-scripts.git
synced 2026-07-06 17:31:40 +00:00
Compare commits
3 commits
cd4052ba6b
...
3aaba1f408
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
3aaba1f408 | ||
|
|
0ef11bf11d | ||
|
|
811df5abf2 |
2 changed files with 11 additions and 4 deletions
|
|
@ -812,10 +812,15 @@
|
||||||
# check if DNS is resolving
|
# check if DNS is resolving
|
||||||
:set IsDNSResolving do={
|
:set IsDNSResolving do={
|
||||||
:do {
|
:do {
|
||||||
:resolve "low-ttl.eworm.de";
|
:local I 1;
|
||||||
|
:retry {
|
||||||
|
:set I ($I ^ 1);
|
||||||
|
:resolve ("low-ttl.eworm." . ({ "de"; "net" }->$I));
|
||||||
|
} delay=50ms max=6;
|
||||||
} on-error={
|
} on-error={
|
||||||
:return false;
|
:return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
:return true;
|
:return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -115,13 +115,15 @@
|
||||||
|
|
||||||
:local Data false;
|
:local Data false;
|
||||||
:onerror Err {
|
:onerror Err {
|
||||||
|
:local I 1;
|
||||||
:retry {
|
:retry {
|
||||||
|
:set I ($I ^ 1);
|
||||||
:set Data ([ /tool/fetch check-certificate=yes-without-crl output=user \
|
:set Data ([ /tool/fetch check-certificate=yes-without-crl output=user \
|
||||||
http-header-field=({ "accept: application/dns-message" }) \
|
http-header-field=({ "accept: application/dns-message" }) \
|
||||||
url=(($DohServer->"doh-url") . "?dns=" . [ :convert to=base64 ([ :rndstr length=2 ] . \
|
url=(($DohServer->"doh-url") . "?dns=" . [ :convert to=base64 ([ :rndstr length=2 ] . \
|
||||||
"\01\00" . "\00\01" . "\00\00" . "\00\00" . "\00\00" . "\09doh-check\05eworm\02de\00" . \
|
"\01\00" . "\00\01" . "\00\00" . "\00\00" . "\00\00" . "\09doh-check\05eworm" . \
|
||||||
"\00\10" . "\00\01") ]) as-value ]->"data");
|
({ "\02de"; "\03net" }->$I) . "\00" . "\00\10" . "\00\01") ]) as-value ]->"data");
|
||||||
} delay=1s max=3;
|
} delay=500ms max=6;
|
||||||
} do={
|
} do={
|
||||||
$LogPrint warning $ScriptName ("Request to DoH server " . ($DohServer->"doh-url") . \
|
$LogPrint warning $ScriptName ("Request to DoH server " . ($DohServer->"doh-url") . \
|
||||||
" failed: " . $Err);
|
" failed: " . $Err);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue