Compare commits

..

90 commits

Author SHA1 Message Date
Christian Hesse
28971c1e88 global-functions: $NetMask6: use shift operator...
... and drop the workaround. This requires RouterOS 7.22beta3.
2026-01-21 08:57:18 +01:00
Christian Hesse
04a33f9ca5 INITIAL-COMMANDS: drop the old builtin-trust-anchors 2026-01-21 08:57:18 +01:00
Christian Hesse
ad32e1af94 global-functions: $CertificateAvailable: drop the old builtin-trust-anchors 2026-01-21 08:57:18 +01:00
Christian Hesse
4e38a6651e README: drop the old builtin-trust-anchors 2026-01-21 08:57:18 +01:00
Christian Hesse
b53f223527 Merge branch 'continue-in-loop' into next 2026-01-21 08:57:18 +01:00
Christian Hesse
1d170071a5 Merge branch 'early-exit-with-exit' into next 2026-01-21 08:57:18 +01:00
Christian Hesse
d55e237fa6 check-certificates: use :continue in loop 2026-01-21 08:57:18 +01:00
Christian Hesse
6cb3ef6053 global-functions: deprecate $ExitError 2026-01-21 08:57:18 +01:00
Christian Hesse
6835b6fd3a global-functions: $ScriptInstallUpdate: fix indention 2026-01-21 08:57:18 +01:00
Christian Hesse
57bc2fc989 update-tunnelbroker: early exit with :exit 2026-01-21 08:57:18 +01:00
Christian Hesse
4abfec4f12 global-functions: $ScriptInstallUpdate: use :continue in loop 2026-01-21 08:57:18 +01:00
Christian Hesse
03946e0d74 update-gre-address: early exit with :exit 2026-01-21 08:57:18 +01:00
Christian Hesse
a802863f4c fw-addr-lists: fix indention 2026-01-21 08:57:18 +01:00
Christian Hesse
740b40e619 telegram-chat: early exit with :exit 2026-01-21 08:57:18 +01:00
Christian Hesse
77319492fe fw-addr-lists: use :continue in loop 2026-01-21 08:57:18 +01:00
Christian Hesse
27004f9138 sms-forward: early exit with :exit 2026-01-21 08:57:18 +01:00
Christian Hesse
56f079b81c telegram-chat: use :continue in loop 2026-01-21 08:57:18 +01:00
Christian Hesse
99a49f3f58 sms-action: early exit with :exit 2026-01-21 08:57:18 +01:00
Christian Hesse
fcb4bfdb1f ppp-on-up: early exit with :exit 2026-01-21 08:57:18 +01:00
Christian Hesse
81b432b18e packages-update: early exit with :exit 2026-01-21 08:57:18 +01:00
Christian Hesse
62200bc753 ospf-to-leds: early exit with :exit 2026-01-21 08:57:18 +01:00
Christian Hesse
7c0b87eabe netwatch-notify: early exit with :exit 2026-01-21 08:57:18 +01:00
Christian Hesse
6149833e4b netwatch-dns: early exit with :exit 2026-01-21 08:57:18 +01:00
Christian Hesse
57bb25828d log-forward: early exit with :exit 2026-01-21 08:57:18 +01:00
Christian Hesse
8d0722d9e1 lease-script: early exit with :exit 2026-01-21 08:57:18 +01:00
Christian Hesse
bba6f24081 ipv6-update: early exit with :exit 2026-01-21 08:57:18 +01:00
Christian Hesse
4b1cc263e4 ipsec-to-dns: early exit with :exit 2026-01-21 08:57:18 +01:00
Christian Hesse
6e3c21cda9 hotspot-to-wpa-cleanup: early exit with :exit 2026-01-21 08:57:18 +01:00
Christian Hesse
c9ad1fd387 hotspot-to-wpa: early exit with :exit 2026-01-21 08:57:18 +01:00
Christian Hesse
89694b937e gps-track: early exit with :exit 2026-01-21 08:57:18 +01:00
Christian Hesse
a3d63b0546 fw-addr-lists: early exit with :exit 2026-01-21 08:57:18 +01:00
Christian Hesse
8914e38555 firmware-upgrade-reboot: early exit with :exit 2026-01-21 08:57:18 +01:00
Christian Hesse
7ce09b1125 dhcp-to-dns: early exit with :exit 2026-01-21 08:57:18 +01:00
Christian Hesse
cabbfbe71e Merge branch 'compare-ids' into next 2026-01-21 08:57:17 +01:00
Christian Hesse
cbbe402a00 dhcp-lease-comment: early exit with :exit 2026-01-21 08:57:17 +01:00
Christian Hesse
e590977d9a 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-21 08:57:17 +01:00
Christian Hesse
c628a6a5d2 global-functions: deprecate $HexToNum 2026-01-21 08:57:17 +01:00
Christian Hesse
5cbf0e9621 daily-psk: early exit with :exit 2026-01-21 08:57:17 +01:00
Christian Hesse
8b7982d73f mod/ssh-keys-import: drop old property
The property name changed in RouterOS 7.21beta2, so bump required
version to 7.21.
2026-01-21 08:57:17 +01:00
Christian Hesse
bd0075af4c log-forward: fix indention 2026-01-21 08:57:17 +01:00
Christian Hesse
e8bff72f4a collect-wireless-mac: early exit with :exit 2026-01-21 08:57:17 +01:00
Christian Hesse
eb514160e8 Merge branch 'certificate-builtin' into next 2026-01-21 08:57:17 +01:00
Christian Hesse
93db7c36ec 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-21 08:57:17 +01:00
Christian Hesse
e8f9b288d4 check-routeros-update: early exit with :exit 2026-01-21 08:57:17 +01:00
Christian Hesse
e40a5575c4 Merge branch 'CommitBrief' into next 2026-01-21 08:57:17 +01:00
Christian Hesse
72940ee746 bump required RouterOS version for all scripts 2026-01-21 08:57:17 +01:00
Christian Hesse
1f0f2375c6 check-perpetual-license: early exit with :exit 2026-01-21 08:57:17 +01:00
Christian Hesse
082f6e4812 Merge branch 'ExitOnError' into next 2026-01-21 08:57:17 +01:00
Christian Hesse
3b98e676c5 README: update screenshots 2026-01-21 08:57:17 +01:00
Christian Hesse
b7c0dab767 README: reword the section on builtin trust store 2026-01-21 08:57:17 +01:00
Christian Hesse
96226c71d3 check-lte-firmware-upgrade: early exit with :exit 2026-01-21 08:57:17 +01:00
Christian Hesse
0db4306795 global-functions: enable scheduler if disabled 2026-01-21 08:57:17 +01:00
Christian Hesse
3baf0bd060 mode-button: use $ExitOnError 2026-01-21 08:57:17 +01:00
Christian Hesse
c76c9591d5 global-functions: $ScriptInstallUpdate: drop output on commit...
... now that we have it on loading global functions.
2026-01-21 08:57:17 +01:00
Christian Hesse
998555932d global-functions: $CertificateAvailable: drop the compatibility workaround...
... and make it depend in RouterOS 7.19 and its builtin certificates.
2026-01-21 08:57:17 +01:00
Christian Hesse
39f993ffbd check-health: early exit with :exit 2026-01-21 08:57:17 +01:00
Christian Hesse
86bf200bb5 global-functions: simplify the scheduler fix 2026-01-21 08:57:17 +01:00
Christian Hesse
80746d4dad mod/ssh-keys-import: use $ExitOnError 2026-01-21 08:57:17 +01:00
Christian Hesse
4fe77ef238 global-functions: give commit info when laoding 2026-01-21 08:57:17 +01:00
Christian Hesse
0de3963278 INITIAL-COMMANDS: drop the compatibility workaround...
... and make it depend in RouterOS 7.19 and its builtin certificates.
2026-01-21 08:57:17 +01:00
Christian Hesse
5590acc86f check-certificates: early exit with :exit 2026-01-21 08:57:17 +01:00
Christian Hesse
ad8299824c global-functions: make the scheduler fix a block 2026-01-21 08:57:17 +01:00
Christian Hesse
b7df0d393a mod/scriptrunonce: use $ExitOnError 2026-01-21 08:57:17 +01:00
Christian Hesse
03010ad9d9 global-functions: $ScriptInstallUpdate: use $CommitBrief 2026-01-21 08:57:17 +01:00
Christian Hesse
125af60b04 check-certificates: drop the compatibility workaround...
... and make it depend in RouterOS 7.19 and its builtin certificates.
2026-01-21 08:57:17 +01:00
Christian Hesse
5c7d0d456f certificate-renew-issued: early exit with :exit 2026-01-21 08:57:17 +01:00
Christian Hesse
8b3fae745d global-functions: $NetMask6: drop unused variable 2026-01-21 08:57:17 +01:00
Christian Hesse
5f8f5e22a7 mod/notification-telegram: use $ExitOnError 2026-01-21 08:57:17 +01:00
Christian Hesse
7f888b197e global-functions: $FetchUserAgentStr: user $CommitBrief 2026-01-21 08:57:17 +01:00
Christian Hesse
223d9fc2e0 capsman-rolling-upgrade: early exit with :exit 2026-01-21 08:57:17 +01:00
Christian Hesse
969658da16 mod/notification-ntfy: use $ExitOnError 2026-01-21 08:57:17 +01:00
Christian Hesse
c81967f63a global-functions: $DeviceInfo: use $CommitBrief 2026-01-21 08:57:17 +01:00
Christian Hesse
31e2e62c56 capsman-download-packages: early exit with :exit 2026-01-21 08:57:17 +01:00
Christian Hesse
6dd37e45d6 mod/notification-matrix: use $ExitOnError 2026-01-21 08:57:17 +01:00
Christian Hesse
005b80b4c5 global-functions: introduce $CommitBrief 2026-01-21 08:57:17 +01:00
Christian Hesse
18f240fb77 backup-upload: early exit with :exit 2026-01-21 08:57:17 +01:00
Christian Hesse
ddf7a015c5 mod/notification-gotify: use $ExitOnError 2026-01-21 08:57:17 +01:00
Christian Hesse
7096b82dea backup-partition: early exit with :exit 2026-01-21 08:57:17 +01:00
Christian Hesse
d4624689ae mod/notification-email: use $ExitOnError 2026-01-21 08:57:17 +01:00
Christian Hesse
5618618d9a backup-email: early exit with :exit 2026-01-21 08:57:17 +01:00
Christian Hesse
2366122a36 mod/ipcalc: use $ExitOnError 2026-01-21 08:57:17 +01:00
Christian Hesse
9041081264 backup-cloud: early exit with :exit 2026-01-21 08:57:17 +01:00
Christian Hesse
c0e802eab9 mod/inspectvar: use $ExitOnError 2026-01-21 08:57:17 +01:00
Christian Hesse
345c8ef6b2 mod/bridge-port-vlan: use $ExitOnError 2026-01-21 08:57:17 +01:00
Christian Hesse
920785c25b mod/bridge-port-to: use $ExitOnError 2026-01-21 08:57:17 +01:00
Christian Hesse
87b80e05cb accesslist-duplicates: use $ExitOnError 2026-01-21 08:57:17 +01:00
Christian Hesse
d0f2ae0033 global-functions: $SendNotification: use $ExitOnError 2026-01-21 08:57:17 +01:00
Christian Hesse
f3d81f7e0d global-functions: $ScriptInstallUpdate: use $ExitOnError 2026-01-21 08:57:17 +01:00
Christian Hesse
5443034897 global-functions: make $ExitError a wrapper for $ExitOnError 2026-01-21 08:57:17 +01:00
Christian Hesse
a8e091dde7 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-21 08:57:17 +01:00
3 changed files with 7 additions and 34 deletions

View file

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

View file

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

View file

@ -128,8 +128,7 @@
}
:local CertSettings [ /certificate/settings/get ];
:if ((($CertSettings->"builtin-trust-anchors") = "trusted" || \
($CertSettings->"builtin-trust-store") ~ $UseFor || \
:if ((($CertSettings->"builtin-trust-store") ~ $UseFor || \
($CertSettings->"builtin-trust-store") = "all") && \
[ :len [ /certificate/builtin/find where common-name=$CommonName ] ] > 0) do={
:return true;
@ -1015,32 +1014,9 @@
# return an IPv6 netmask for CIDR
:set NetMask6 do={
:local FuncName $0;
:local CIDR [ :tostr $1 ];
:local CIDR [ :tonum $1 ];
: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;
:return (((~::) << (128 - $CIDR)) & (~::));
}
# prepare NotificationFunctions array