From 3801cc4847cc3b3ef58ecf6cfddaf6ea162f5f89 Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Tue, 7 Jul 2026 13:13:31 +0200 Subject: [PATCH 1/2] 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. --- global-functions.rsc | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/global-functions.rsc b/global-functions.rsc index 5cadb24f..c45aa97e 100644 --- a/global-functions.rsc +++ b/global-functions.rsc @@ -1318,12 +1318,14 @@ :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={ + :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={ } + } :foreach Script in=[ /system/script/find where source~"^#!rsc by RouterOS\r?\n" ] do={ :local ScriptVal [ /system/script/get $Script ]; From 55eef9c69222d9cd718999e67ff685b3e2c26d57 Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Tue, 7 Jul 2026 13:18:34 +0200 Subject: [PATCH 2/2] global-functions: $ScriptInstallUpdate: log and print error It is no longer expected to fail... So let's complain. --- global-functions.rsc | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/global-functions.rsc b/global-functions.rsc index c45aa97e..61408bec 100644 --- a/global-functions.rsc +++ b/global-functions.rsc @@ -1319,12 +1319,14 @@ :local CheckSums ({}); :if ([ :pick $ScriptUpdatesBaseUrl 0 21 ] = "https://rsc.eworm.de/") do={ - :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") ]; - } on-error={ } + } do={ + $LogPrint warning $0 ("Failed downloading checksums: " . $Err); + } } :foreach Script in=[ /system/script/find where source~"^#!rsc by RouterOS\r?\n" ] do={