Compare commits

..

2 commits

Author SHA1 Message Date
Christian Hesse
55eef9c692 global-functions: $ScriptInstallUpdate: log and print error
It is no longer expected to fail... So let's complain.
2026-07-07 15:15:22 +02:00
Christian Hesse
3801cc4847 global-functions: $ScriptInstallUpdate: skip checksums if not rsc.eworm.de
The file is not in git repository, but generated when deploying to my
server only.
2026-07-07 15:15:22 +02:00

View file

@ -1318,12 +1318,16 @@
:local DeviceMode [ /system/device-mode/get ];
:local CheckSums ({});
:do {
:local Url ($ScriptUpdatesBaseUrl . "checksums.json" . $ScriptUpdatesUrlSuffix);
$LogPrint debug $0 ("Fetching checksums from url: " . $Url);
:set CheckSums [ :deserialize from=json ([ /tool/fetch check-certificate=yes-without-crl \
http-header-field=({ [ $FetchUserAgentStr $0 ] }) $Url output=user as-value ]->"data") ];
} on-error={ }
:if ([ :pick $ScriptUpdatesBaseUrl 0 21 ] = "https://rsc.eworm.de/") do={
:onerror Err {
:local Url ($ScriptUpdatesBaseUrl . "checksums.json" . $ScriptUpdatesUrlSuffix);
$LogPrint debug $0 ("Fetching checksums from url: " . $Url);
:set CheckSums [ :deserialize from=json ([ /tool/fetch check-certificate=yes-without-crl \
http-header-field=({ [ $FetchUserAgentStr $0 ] }) $Url output=user as-value ]->"data") ];
} do={
$LogPrint warning $0 ("Failed downloading checksums: " . $Err);
}
}
:foreach Script in=[ /system/script/find where source~"^#!rsc by RouterOS\r?\n" ] do={
:local ScriptVal [ /system/script/get $Script ];