mirror of
https://github.com/eworm-de/routeros-scripts.git
synced 2026-07-16 14:21:34 +00:00
netwatch-dns: check with a HTTP/2 request
We need RouterOS 7.24 for this to catch runtime errors for bad command parameters. Actually this would work with RouterOS 7.23 on architectures that support http-version=http2 ...
This commit is contained in:
parent
8c6707befd
commit
8109b4fca5
2 changed files with 11 additions and 6 deletions
|
|
@ -4,7 +4,7 @@ Manage DNS and DoH servers from netwatch
|
||||||
[](https://github.com/eworm-de/routeros-scripts/stargazers)
|
[](https://github.com/eworm-de/routeros-scripts/stargazers)
|
||||||
[](https://github.com/eworm-de/routeros-scripts/network)
|
[](https://github.com/eworm-de/routeros-scripts/network)
|
||||||
[](https://github.com/eworm-de/routeros-scripts/watchers)
|
[](https://github.com/eworm-de/routeros-scripts/watchers)
|
||||||
[](https://mikrotik.com/download/changelogs/)
|
[](https://mikrotik.com/download/changelogs/)
|
||||||
[](https://t.me/routeros_scripts)
|
[](https://t.me/routeros_scripts)
|
||||||
[](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=A4ZXBD6YS2W8J)
|
[](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=A4ZXBD6YS2W8J)
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,7 @@
|
||||||
# Copyright (c) 2022-2026 Christian Hesse <mail@eworm.de>
|
# Copyright (c) 2022-2026 Christian Hesse <mail@eworm.de>
|
||||||
# https://rsc.eworm.de/COPYING.md
|
# https://rsc.eworm.de/COPYING.md
|
||||||
#
|
#
|
||||||
# requires RouterOS, version=7.22
|
# requires RouterOS, version=7.24rc1
|
||||||
# requires device-mode, fetch
|
# requires device-mode, fetch
|
||||||
#
|
#
|
||||||
# monitor and manage dns/doh with netwatch
|
# monitor and manage dns/doh with netwatch
|
||||||
|
|
@ -113,11 +113,16 @@
|
||||||
:local I 1;
|
:local I 1;
|
||||||
:retry {
|
:retry {
|
||||||
:set I ($I ^ 1);
|
:set I ($I ^ 1);
|
||||||
:set Data ([ /tool/fetch check-certificate=yes-without-crl output=user \
|
:local Url (($DohServer->"doh-url") . "?dns=" . [ :convert to=base64 ([ :rndstr length=2 ] . \
|
||||||
http-header-field=({ "accept: application/dns-message" }) \
|
|
||||||
url=(($DohServer->"doh-url") . "?dns=" . [ :convert to=base64 ([ :rndstr length=2 ] . \
|
|
||||||
"\01\00" . "\00\01" . "\00\00" . "\00\00" . "\00\00" . "\09doh-check\05eworm" . \
|
"\01\00" . "\00\01" . "\00\00" . "\00\00" . "\00\00" . "\09doh-check\05eworm" . \
|
||||||
({ "\02de"; "\03net" }->$I) . "\00" . "\00\10" . "\00\01") ]) as-value ]->"data");
|
({ "\02de"; "\03net" }->$I) . "\00" . "\00\10" . "\00\01") ]);
|
||||||
|
:do {
|
||||||
|
:set Data ([ /tool/fetch check-certificate=yes-without-crl output=user http-version=http2 \
|
||||||
|
http-header-field=({ "accept: application/dns-message" }) url=$Url as-value ]->"data");
|
||||||
|
} on-error={
|
||||||
|
:set Data ([ /tool/fetch check-certificate=yes-without-crl output=user \
|
||||||
|
http-header-field=({ "accept: application/dns-message" }) url=$Url as-value ]->"data");
|
||||||
|
}
|
||||||
} delay=500ms max=6;
|
} 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") . \
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue