Compare commits

..

84 commits

Author SHA1 Message Date
Christian Hesse
181a559499 Merge branch 'continue-in-loop' into next 2026-01-20 19:15:33 +01:00
Christian Hesse
e7cdfe3f32 Merge branch 'early-exit-with-exit' into next 2026-01-20 19:15:33 +01:00
Christian Hesse
2d2bc87237 check-certificates: use :continue in loop 2026-01-20 19:15:33 +01:00
Christian Hesse
0be3d7c67d global-functions: deprecate $ExitError 2026-01-20 19:15:33 +01:00
Christian Hesse
52c166b4bf global-functions: $ScriptInstallUpdate: fix indention 2026-01-20 19:15:33 +01:00
Christian Hesse
811973cecf update-tunnelbroker: early exit with :exit 2026-01-20 19:15:33 +01:00
Christian Hesse
510e196d21 global-functions: $ScriptInstallUpdate: use :continue in loop 2026-01-20 19:15:33 +01:00
Christian Hesse
297d679b81 update-gre-address: early exit with :exit 2026-01-20 19:15:33 +01:00
Christian Hesse
d033097115 fw-addr-lists: fix indention 2026-01-20 19:15:33 +01:00
Christian Hesse
f351341909 telegram-chat: early exit with :exit 2026-01-20 19:15:33 +01:00
Christian Hesse
bb65be7feb fw-addr-lists: use :continue in loop 2026-01-20 19:15:33 +01:00
Christian Hesse
f145461ad0 sms-forward: early exit with :exit 2026-01-20 19:15:33 +01:00
Christian Hesse
77e80125be telegram-chat: use :continue in loop 2026-01-20 19:15:33 +01:00
Christian Hesse
b462fa7f3b sms-action: early exit with :exit 2026-01-20 19:15:33 +01:00
Christian Hesse
a5fe3a3c9d ppp-on-up: early exit with :exit 2026-01-20 19:15:33 +01:00
Christian Hesse
24d6933e59 packages-update: early exit with :exit 2026-01-20 19:15:33 +01:00
Christian Hesse
1f1c4a22b6 ospf-to-leds: early exit with :exit 2026-01-20 19:15:33 +01:00
Christian Hesse
b52ac03dbb netwatch-notify: early exit with :exit 2026-01-20 19:15:33 +01:00
Christian Hesse
b8fa446f82 netwatch-dns: early exit with :exit 2026-01-20 19:15:33 +01:00
Christian Hesse
c7448103e4 log-forward: early exit with :exit 2026-01-20 19:15:33 +01:00
Christian Hesse
350a825250 lease-script: early exit with :exit 2026-01-20 19:15:33 +01:00
Christian Hesse
42a964ba45 ipv6-update: early exit with :exit 2026-01-20 19:15:33 +01:00
Christian Hesse
c0712abe92 ipsec-to-dns: early exit with :exit 2026-01-20 19:15:33 +01:00
Christian Hesse
170d35b0ea hotspot-to-wpa-cleanup: early exit with :exit 2026-01-20 19:15:33 +01:00
Christian Hesse
3db31b694a hotspot-to-wpa: early exit with :exit 2026-01-20 19:15:33 +01:00
Christian Hesse
a1ade72d6b gps-track: early exit with :exit 2026-01-20 19:15:33 +01:00
Christian Hesse
6ee0747c6f fw-addr-lists: early exit with :exit 2026-01-20 19:15:33 +01:00
Christian Hesse
3aac53c1e8 firmware-upgrade-reboot: early exit with :exit 2026-01-20 19:15:33 +01:00
Christian Hesse
9450374649 dhcp-to-dns: early exit with :exit 2026-01-20 19:15:33 +01:00
Christian Hesse
b517b16b79 Merge branch 'compare-ids' into next 2026-01-20 19:15:32 +01:00
Christian Hesse
d7c832889d dhcp-lease-comment: early exit with :exit 2026-01-20 19:15:32 +01:00
Christian Hesse
f57ab70bc8 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-01-20 19:15:32 +01:00
Christian Hesse
3d2ad9e624 global-functions: deprecate $HexToNum 2026-01-20 19:15:32 +01:00
Christian Hesse
72528501c9 daily-psk: early exit with :exit 2026-01-20 19:15:32 +01:00
Christian Hesse
e6a80af041 mod/ssh-keys-import: drop old property
The property name changed in RouterOS 7.21beta2, so bump required
version to 7.21.
2026-01-20 19:15:32 +01:00
Christian Hesse
6bf3bc6250 log-forward: fix indention 2026-01-20 19:15:32 +01:00
Christian Hesse
434b7509e4 collect-wireless-mac: early exit with :exit 2026-01-20 19:15:32 +01:00
Christian Hesse
ba3490f154 Merge branch 'certificate-builtin' into next 2026-01-20 19:15:32 +01:00
Christian Hesse
27a0c9f66b 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-01-20 19:15:32 +01:00
Christian Hesse
3f89ccc4db check-routeros-update: early exit with :exit 2026-01-20 19:15:32 +01:00
Christian Hesse
d8443529cc Merge branch 'CommitBrief' into next 2026-01-20 19:15:32 +01:00
Christian Hesse
66c0259700 bump required RouterOS version for all scripts 2026-01-20 19:15:32 +01:00
Christian Hesse
2b2772b899 check-perpetual-license: early exit with :exit 2026-01-20 19:15:32 +01:00
Christian Hesse
9f1bd7b9d3 Merge branch 'ExitOnError' into next 2026-01-20 19:15:32 +01:00
Christian Hesse
8ae7bd3a14 README: update screenshots 2026-01-20 19:15:32 +01:00
Christian Hesse
710f812896 global-functions: $CertificateAvailable: drop the compatibility workaround...
... and make it depend in RouterOS 7.19 and its builtin certificates.
2026-01-20 19:15:32 +01:00
Christian Hesse
e18a3ec915 check-lte-firmware-upgrade: early exit with :exit 2026-01-20 19:15:32 +01:00
Christian Hesse
eea24a785f global-functions: enable scheduler if disabled 2026-01-20 19:15:32 +01:00
Christian Hesse
9f9a43e9f6 mode-button: use $ExitOnError 2026-01-20 19:15:32 +01:00
Christian Hesse
70481f6321 global-functions: $ScriptInstallUpdate: drop output on commit...
... now that we have it on loading global functions.
2026-01-20 19:15:32 +01:00
Christian Hesse
dd56301c40 INITIAL-COMMANDS: drop the compatibility workaround...
... and make it depend in RouterOS 7.19 and its builtin certificates.
2026-01-20 19:15:32 +01:00
Christian Hesse
fd1950265a check-health: early exit with :exit 2026-01-20 19:15:32 +01:00
Christian Hesse
ee9a7512e0 mod/ssh-keys-import: use $ExitOnError 2026-01-20 19:15:32 +01:00
Christian Hesse
36d6a4235a global-functions: give commit info when laoding 2026-01-20 19:15:32 +01:00
Christian Hesse
af75d95211 check-certificates: drop the compatibility workaround...
... and make it depend in RouterOS 7.19 and its builtin certificates.
2026-01-20 19:15:32 +01:00
Christian Hesse
242c0080eb check-certificates: early exit with :exit 2026-01-20 19:15:32 +01:00
Christian Hesse
d48cd15541 mod/scriptrunonce: use $ExitOnError 2026-01-20 19:15:32 +01:00
Christian Hesse
eab3b731f5 global-functions: $ScriptInstallUpdate: use $CommitBrief 2026-01-20 19:15:32 +01:00
Christian Hesse
01ee5ad80d certificate-renew-issued: early exit with :exit 2026-01-20 19:15:32 +01:00
Christian Hesse
3fa0f8192f mod/notification-telegram: use $ExitOnError 2026-01-20 19:15:32 +01:00
Christian Hesse
a41f3a07f0 global-functions: $FetchUserAgentStr: user $CommitBrief 2026-01-20 19:15:32 +01:00
Christian Hesse
05a3764b1b capsman-rolling-upgrade: early exit with :exit 2026-01-20 19:15:32 +01:00
Christian Hesse
7cffa69189 mod/notification-ntfy: use $ExitOnError 2026-01-20 19:15:32 +01:00
Christian Hesse
00c44276df global-functions: $DeviceInfo: use $CommitBrief 2026-01-20 19:15:32 +01:00
Christian Hesse
c880274748 capsman-download-packages: early exit with :exit 2026-01-20 19:15:32 +01:00
Christian Hesse
0522370dee mod/notification-matrix: use $ExitOnError 2026-01-20 19:15:32 +01:00
Christian Hesse
680a47f6fe global-functions: introduce $CommitBrief 2026-01-20 19:15:32 +01:00
Christian Hesse
d4d7b23dbb backup-upload: early exit with :exit 2026-01-20 19:15:32 +01:00
Christian Hesse
c355745efb mod/notification-gotify: use $ExitOnError 2026-01-20 19:15:32 +01:00
Christian Hesse
6b5610dcec backup-partition: early exit with :exit 2026-01-20 19:15:32 +01:00
Christian Hesse
9250d2dced mod/notification-email: use $ExitOnError 2026-01-20 19:15:32 +01:00
Christian Hesse
2cba8f3617 backup-email: early exit with :exit 2026-01-20 19:15:32 +01:00
Christian Hesse
bf1a54f677 mod/ipcalc: use $ExitOnError 2026-01-20 19:15:32 +01:00
Christian Hesse
5e7a6fe9cc backup-cloud: early exit with :exit 2026-01-20 19:15:32 +01:00
Christian Hesse
6ca12aaa27 mod/inspectvar: use $ExitOnError 2026-01-20 19:15:32 +01:00
Christian Hesse
dfae818b80 mod/bridge-port-vlan: use $ExitOnError 2026-01-20 19:15:32 +01:00
Christian Hesse
66d1b8481d mod/bridge-port-to: use $ExitOnError 2026-01-20 19:15:32 +01:00
Christian Hesse
26a886856d accesslist-duplicates: use $ExitOnError 2026-01-20 19:15:32 +01:00
Christian Hesse
9f1d6fdc89 global-functions: $SendNotification: use $ExitOnError 2026-01-20 19:15:32 +01:00
Christian Hesse
f35055e24e global-functions: $ScriptInstallUpdate: use $ExitOnError 2026-01-20 19:15:32 +01:00
Christian Hesse
b436e39db5 global-functions: make $ExitError a wrapper for $ExitOnError 2026-01-20 19:15:32 +01:00
Christian Hesse
8f32d8e705 global-functions: introduce $ExitOnError
This is just like $ExitError, but first parameter is dropped. We will
not need it now that we can exit a script with :exit.
2026-01-20 19:15:32 +01:00
Christian Hesse
ab01fce80a global-functions: simplify the scheduler fix 2026-01-20 19:15:28 +01:00
Christian Hesse
af3a64c6a2 global-functions: make the scheduler fix a block 2026-01-20 19:14:55 +01:00
3 changed files with 34 additions and 7 deletions

View file

@ -23,7 +23,8 @@ Run the complete base installation:
:local CertFingerprint "e14ffcad5b0025731006caa43a121a22d8e9700f4fb9cf852f02a708aa5d5666"; :local CertFingerprint "e14ffcad5b0025731006caa43a121a22d8e9700f4fb9cf852f02a708aa5d5666";
:local CertSettings [ /certificate/settings/get ]; :local CertSettings [ /certificate/settings/get ];
:if (!((($CertSettings->"builtin-trust-store") ~ "fetch" || \ :if (!((($CertSettings->"builtin-trust-anchors") = "trusted" || \
($CertSettings->"builtin-trust-store") ~ "fetch" || \
($CertSettings->"builtin-trust-store") = "all") && \ ($CertSettings->"builtin-trust-store") = "all") && \
[ :len [ /certificate/builtin/find where common-name=$CertCommonName ] ] > 0)) do={ [ :len [ /certificate/builtin/find where common-name=$CertCommonName ] ] > 0)) do={
:put "Importing certificate..."; :put "Importing certificate...";

View file

@ -100,11 +100,13 @@ including demonstration recorded live at [MUM Europe
The update script does server certificate verification, so first step is to The update script does server certificate verification, so first step is to
download the certificates. download the certificates.
> 💡️ **Hint**: RouterOS comes with a builtin certificate store. You > 💡️ **Hint**: RouterOS 7.19 comes with a builtin certificate store. You
> can skip the steps regarding certificate download and import and jump > can skip the steps regarding certificate download and import and jump
> to [installation of scripts](#installation-of-scripts) if you set the > to [installation of scripts](#installation-of-scripts) if you set the
> certificates to be trusted my the `fetch` command at least. But make > trust for these builtin trust anchors:
> sure not to drop other targets: > `/certificate/settings/set builtin-trust-anchors=trusted;`
> With RouterOS 7.21 the functionality was changed. Set this at minimum,
> but make sure not to drop other targets:
> `/certificate/settings/set builtin-trust-store=fetch;` > `/certificate/settings/set builtin-trust-store=fetch;`
If you intend to download the scripts from a If you intend to download the scripts from a

View file

@ -128,7 +128,8 @@
} }
:local CertSettings [ /certificate/settings/get ]; :local CertSettings [ /certificate/settings/get ];
:if ((($CertSettings->"builtin-trust-store") ~ $UseFor || \ :if ((($CertSettings->"builtin-trust-anchors") = "trusted" || \
($CertSettings->"builtin-trust-store") ~ $UseFor || \
($CertSettings->"builtin-trust-store") = "all") && \ ($CertSettings->"builtin-trust-store") = "all") && \
[ :len [ /certificate/builtin/find where common-name=$CommonName ] ] > 0) do={ [ :len [ /certificate/builtin/find where common-name=$CommonName ] ] > 0) do={
:return true; :return true;
@ -1014,9 +1015,32 @@
# return an IPv6 netmask for CIDR # return an IPv6 netmask for CIDR
:set NetMask6 do={ :set NetMask6 do={
:local CIDR [ :tonum $1 ]; :local FuncName $0;
:local CIDR [ :tostr $1 ];
:return (((~::) << (128 - $CIDR)) & (~::)); :global IfThenElse;
:global MAX;
:global MIN;
:global NetMask6Cache;
:if ([ :typeof ($NetMask6Cache->$CIDR) ] = "ip6") do={
:return ($NetMask6Cache->$CIDR);
}
:if ([ :typeof $NetMask6Cache ] = "nothing") do={
:set NetMask6Cache ({});
}
:local Mask "";
:for I from=0 to=7 do={
:set Mask ($Mask . \
[ :convert from=num to=hex (0xffff - (0xffff >> [ :tonum [ $MIN [ $MAX ($CIDR - (16 * $I)) 0 ] 16 ] ])) ] . \
[ $IfThenElse ($I < 7) ":" ]);
}
:set Mask [ :toip6 $Mask ];
:set ($NetMask6Cache->$CIDR) $Mask;
:return $Mask;
} }
# prepare NotificationFunctions array # prepare NotificationFunctions array