Compare commits

..

72 commits

Author SHA1 Message Date
Christian Hesse
0b87310301 dhcp-to-dns: support to ignore networks
Closes: https://github.com/eworm-de/routeros-scripts/issues/119
2026-04-22 11:10:15 +02:00
Christian Hesse
604a6b8bed bump required RouterOS version for all scripts 2026-04-22 11:10:15 +02:00
Christian Hesse
dc44c0ae81 global-functions: $NetMask6: use shift operator...
... and drop the workaround. This requires RouterOS 7.22beta3.
2026-04-22 11:10:15 +02:00
Christian Hesse
29a9afc16e Merge branch 'break-in-loop' into next 2026-04-22 11:10:15 +02:00
Christian Hesse
5d31c7fe97 Merge branch 'continue-in-loop' into next 2026-04-22 11:10:15 +02:00
Christian Hesse
5bba3b1864 telegram-chat: fix indention 2026-04-22 11:10:15 +02:00
Christian Hesse
71a26889a4 Merge branch 'early-exit-with-exit' into next 2026-04-22 11:10:15 +02:00
Christian Hesse
a9783861b4 dhcp-to-dns: fix indention 2026-04-22 11:10:15 +02:00
Christian Hesse
297566ed65 telegram-chat: use :break in loop 2026-04-22 11:10:15 +02:00
Christian Hesse
fd2550e535 Merge branch 'compare-ids' into next 2026-04-22 11:10:15 +02:00
Christian Hesse
1ec29b6e0e global-functions: deprecate $ExitError 2026-04-22 11:10:15 +02:00
Christian Hesse
9562c83ae3 dhcp-to-dns: use another :continue in loop 2026-04-22 11:10:15 +02:00
Christian Hesse
5b92940f84 check-certificates: use :break in loop 2026-04-22 11:10:15 +02:00
Christian Hesse
a9d64db101 Merge branch 'drop-builtin-trust-anchors' into next 2026-04-22 11:10:15 +02:00
Christian Hesse
f3c3ec9380 global-functions: deprecate $HexToNum 2026-04-22 11:10:15 +02:00
Christian Hesse
e8bf1dce94 update-tunnelbroker: early exit with :exit 2026-04-22 11:10:15 +02:00
Christian Hesse
59db8187a8 dhcp-to-dns: use :continue in loop 2026-04-22 11:10:15 +02:00
Christian Hesse
ff6bd36921 mod/notification-email: get property by name 2026-04-22 11:10:15 +02:00
Christian Hesse
e5796a0d4f INITIAL-COMMANDS: drop the old builtin-trust-anchors 2026-04-22 11:10:15 +02:00
Christian Hesse
68e21a3da2 log-forward: fix indention 2026-04-22 11:10:15 +02:00
Christian Hesse
cba6ea1653 update-gre-address: early exit with :exit 2026-04-22 11:10:15 +02:00
Christian Hesse
36a1bc538e telegram-chat: use :continue in loop 2026-04-22 11:10:15 +02:00
Christian Hesse
32be7bd702 mod/notification-email: use errors from command...
... instead of reading status from properties. This was introduced in
RouterOS 7.21beta2 (and we bump to 7.21 instead).
2026-04-22 11:10:15 +02:00
Christian Hesse
6ef6db7f8b global-functions: $CertificateDownload: drop the old builtin-trust-anchors 2026-04-22 11:10:15 +02:00
Christian Hesse
41f2c83b47 log-forward: use comparison for ids
This was introduced with RouterOS 7.22beta1.

Initializing $LogForwardLast with boolean value looks odd, but this is
reuqired to match the very first message.
2026-04-22 11:10:15 +02:00
Christian Hesse
9126f043fa telegram-chat: early exit with :exit 2026-04-22 11:10:15 +02:00
Christian Hesse
4e0f345a04 netwatch-dns: fix indention 2026-04-22 11:10:15 +02:00
Christian Hesse
cb54859cad mod/notification-email: add setting for certificate verification 2026-04-22 11:10:15 +02:00
Christian Hesse
42059ef78f global-functions: $CertificateAvailable: drop the old builtin-trust-anchors 2026-04-22 11:10:15 +02:00
Christian Hesse
2b99e3061a sms-forward: early exit with :exit 2026-04-22 11:10:15 +02:00
Christian Hesse
bf77b845b9 netwatch-dns: use :continue in loop 2026-04-22 11:10:15 +02:00
Christian Hesse
96f57a9096 README: drop the old builtin-trust-anchors 2026-04-22 11:10:15 +02:00
Christian Hesse
bddb51064e sms-action: early exit with :exit 2026-04-22 11:10:15 +02:00
Christian Hesse
fcbe474d1a netwatch-dns: fix indention 2026-04-22 11:10:15 +02:00
Christian Hesse
c9853049af ppp-on-up: early exit with :exit 2026-04-22 11:10:15 +02:00
Christian Hesse
d5e063d759 netwatch-dns: use :continue in loop 2026-04-22 11:10:15 +02:00
Christian Hesse
59d66b3261 packages-update: early exit with :exit 2026-04-22 11:10:15 +02:00
Christian Hesse
67b3da107f global-functions: $ScriptInstallUpdate: fix indention 2026-04-22 11:10:15 +02:00
Christian Hesse
0740e343e2 ospf-to-leds: early exit with :exit 2026-04-22 11:10:15 +02:00
Christian Hesse
21d2bf0d90 global-functions: $ScriptInstallUpdate: use :continue in loop 2026-04-22 11:10:15 +02:00
Christian Hesse
570d539476 netwatch-notify: early exit with :exit 2026-04-22 11:10:15 +02:00
Christian Hesse
aa4dd64ea8 fw-addr-lists: fix indention 2026-04-22 11:10:15 +02:00
Christian Hesse
1b30e2fc5b netwatch-dns: early exit with :exit 2026-04-22 11:10:15 +02:00
Christian Hesse
9cbbdad9e9 fw-addr-lists: use :continue in loop 2026-04-22 11:10:15 +02:00
Christian Hesse
42fc4e0f39 log-forward: early exit with :exit 2026-04-22 11:10:15 +02:00
Christian Hesse
85f4319593 ipv6-update: early exit with :exit 2026-04-22 11:10:15 +02:00
Christian Hesse
f610b1edee ipsec-to-dns: early exit with :exit 2026-04-22 11:10:15 +02:00
Christian Hesse
088d9bd081 hotspot-to-wpa-cleanup: early exit with :exit 2026-04-22 11:10:15 +02:00
Christian Hesse
fd6e1173c0 hotspot-to-wpa: early exit with :exit 2026-04-22 11:10:15 +02:00
Christian Hesse
7de385d27c gps-track: early exit with :exit 2026-04-22 11:10:15 +02:00
Christian Hesse
fc75f98657 fw-addr-lists: early exit with :exit 2026-04-22 11:10:15 +02:00
Christian Hesse
d8169c6bb5 firmware-upgrade-reboot: early exit with :exit 2026-04-22 11:10:15 +02:00
Christian Hesse
4fd526696e dhcpv6-client-lease: early exit with :exit 2026-04-22 11:10:15 +02:00
Christian Hesse
7f0fbbb397 dhcpv4-server-lease: early exit with :exit 2026-04-22 11:10:15 +02:00
Christian Hesse
c63b19f4cb dhcp-to-dns: early exit with :exit 2026-04-22 11:10:15 +02:00
Christian Hesse
3336bfa4d5 dhcp-lease-comment: early exit with :exit 2026-04-22 11:10:15 +02:00
Christian Hesse
dbab186376 daily-psk: early exit with :exit 2026-04-22 11:10:15 +02:00
Christian Hesse
a5ff54e9f5 collect-wireless-mac: early exit with :exit 2026-04-22 11:10:15 +02:00
Christian Hesse
f314ce92d5 check-routeros-update: early exit with :exit 2026-04-22 11:10:15 +02:00
Christian Hesse
bc195a192b check-perpetual-license: early exit with :exit 2026-04-22 11:10:15 +02:00
Christian Hesse
1e4ded15ea check-lte-firmware-upgrade: early exit with :exit 2026-04-22 11:10:15 +02:00
Christian Hesse
490df0cb84 check-health: early exit with :exit 2026-04-22 11:10:15 +02:00
Christian Hesse
8c487c8190 check-certificates: early exit with :exit 2026-04-22 11:10:15 +02:00
Christian Hesse
15ea9f9795 certificate-renew-issued: early exit with :exit 2026-04-22 11:10:15 +02:00
Christian Hesse
8ff4ecc68a capsman-rolling-upgrade: early exit with :exit 2026-04-22 11:10:15 +02:00
Christian Hesse
7ce1931156 capsman-download-packages: early exit with :exit 2026-04-22 11:10:15 +02:00
Christian Hesse
a41d33a7ba backup-upload: early exit with :exit 2026-04-22 11:10:15 +02:00
Christian Hesse
b7c1eb1067 backup-partition: early exit with :exit 2026-04-22 11:10:15 +02:00
Christian Hesse
90758e3d53 backup-email: early exit with :exit 2026-04-22 11:10:15 +02:00
Christian Hesse
2f07a4978b backup-cloud: early exit with :exit 2026-04-22 11:10:15 +02:00
Christian Hesse
3476ce35b3 global-functions: $CertificateDownload: extend the check for builtin certificates 2026-04-22 10:05:16 +02:00
Christian Hesse
be69b98d8c global-functions: $CertificateAvailable: warn on undefined intended use 2026-04-22 10:05:16 +02:00
4 changed files with 22 additions and 4 deletions

View file

@ -37,7 +37,8 @@ Also make sure the device has correct time configured, best is to set up
the ntp client.
Then edit `global-config-overlay`, add `EmailGeneralTo` with a valid
recipient address. Finally reload the configuration.
recipient address. Optionally add `EmailServerCertificate` if you have
certificate verification enabled. Finally reload the configuration.
> **Info**: Copy relevant configuration from
> [`global-config`](../../global-config.rsc) (the one without `-overlay`) to

View file

@ -31,6 +31,7 @@
:global EmailGeneralCc "";
#:global EmailGeneralTo "mail@example.com";
#:global EmailGeneralCc "another@example.com,third@example.com";
:global EmailServerCertificate "";
# You can send Telegram notifications. Register a bot
# and add the token and chat ids here, then install the module:

View file

@ -109,11 +109,13 @@
:local UseFor [ :tostr $2 ];
:global CertificateDownload;
:global EitherOr;
:global LogPrint;
:global ParseKeyValueStore;
:set UseFor [ $EitherOr $UseFor "undefined" ];
:if ([ :len $UseFor ] = 0) do={
$LogPrint warning $0 ("The intended use is undefined!");
:set UseFor "undefined";
}
:if ([ /system/resource/get free-hdd-space ] < 8388608 && \
[ /certificate/settings/get crl-download ] = true && \
@ -186,7 +188,11 @@
$LogPrint warning $0 ("Failed downloading certificate with CommonName '" . $CommonName . \
"' from repository! Trying fallback to mkcert.org...");
:do {
:if ([ :len [ /certificate/find where common-name="ISRG Root X1" ] ] = 0) do={
:local CertSettings [ /certificate/settings/get ];
:if ([ :len [ /certificate/find where common-name="ISRG Root X1" ] ] = 0 && \
!((($CertSettings->"builtin-trust-store") ~ "fetch" || \
($CertSettings->"builtin-trust-store") = "all") && \
[ :len [ /certificate/builtin/find where common-name="ISRG Root X1" ] ] > 0)) do={
$LogPrint error $0 ("Required certificate is not available.");
:return false;
}

View file

@ -37,7 +37,9 @@
# flush e-mail queue
:set FlushEmailQueue do={ :onerror Err {
:global EmailQueue;
:global EmailServerCertificate;
:global CertificateAvailable;
:global EitherOr;
:global EMailGenerateFrom;
:global FileExists;
@ -90,6 +92,14 @@
:return false;
}
:if ([ /tool/e-mail/get certificate-verification ] ~ "^yes" && \
[ :len $EmailServerCertificate ] > 0) do={
:if ([ $CertificateAvailable $EmailServerCertificate "email" ] = false) do={
$LogPrint warning $0 ("Downloading required certificate failed.");
:return false;
}
}
/system/scheduler/set interval=($QueueLen . "m") comment="Sending..." \
[ find where name="_FlushEmailQueue" ];