global-functions: $ScriptInstallUpdate: drop support for scripts from storage

Nobody ever used that, no?
(Well, except me - just before I implemented fetching. 😜)
This commit is contained in:
Christian Hesse 2023-10-13 17:27:52 +02:00
parent 7a1ffb659c
commit 382f928568
3 changed files with 4 additions and 12 deletions

View file

@ -202,8 +202,7 @@
# This is the address used to send gps data to. # This is the address used to send gps data to.
:global GpsTrackUrl "https://example.com/index.php"; :global GpsTrackUrl "https://example.com/index.php";
# Enable this to fetch scripts from given url. # This is the base url to fetch scripts from.
:global ScriptUpdatesFetch true;
:global ScriptUpdatesBaseUrl "https://git.eworm.de/cgit/routeros-scripts/plain/"; :global ScriptUpdatesBaseUrl "https://git.eworm.de/cgit/routeros-scripts/plain/";
# alternative urls - main: stable code - next: currently in development # alternative urls - main: stable code - next: currently in development
#:global ScriptUpdatesBaseUrl "https://raw.githubusercontent.com/eworm-de/routeros-scripts/main/"; #:global ScriptUpdatesBaseUrl "https://raw.githubusercontent.com/eworm-de/routeros-scripts/main/";

View file

@ -12,7 +12,7 @@
:local 0 "global-functions"; :local 0 "global-functions";
# expected configuration version # expected configuration version
:global ExpectedConfigVersion 109; :global ExpectedConfigVersion 110;
# global variables not to be changed by user # global variables not to be changed by user
:global GlobalFunctionsReady false; :global GlobalFunctionsReady false;
@ -843,7 +843,6 @@
:global IDonate; :global IDonate;
:global NoNewsAndChangesNotification; :global NoNewsAndChangesNotification;
:global ScriptUpdatesBaseUrl; :global ScriptUpdatesBaseUrl;
:global ScriptUpdatesFetch;
:global ScriptUpdatesUrlSuffix; :global ScriptUpdatesUrlSuffix;
:global CertificateAvailable; :global CertificateAvailable;
@ -878,12 +877,8 @@
:foreach Script in=[ /system/script/find where source~"^#!rsc by RouterOS\r?\n" ] do={ :foreach Script in=[ /system/script/find where source~"^#!rsc by RouterOS\r?\n" ] do={
:local ScriptVal [ /system/script/get $Script ]; :local ScriptVal [ /system/script/get $Script ];
:local ScriptFile [ /file/find where name=("script-updates/" . $ScriptVal->"name") . ".rsc" ]; :local ScriptInfo [ $ParseKeyValueStore ($ScriptVal->"comment") ];
:local SourceNew; :local SourceNew;
:if ([ :len $ScriptFile ] > 0) do={
:set SourceNew [ /file/get $ScriptFile contents ];
/file/remove $ScriptFile;
}
:foreach Scheduler in=[ /system/scheduler/find where on-event~("\\b" . $ScriptVal->"name" . "\\b") ] do={ :foreach Scheduler in=[ /system/scheduler/find where on-event~("\\b" . $ScriptVal->"name" . "\\b") ] do={
:local SchedulerVal [ /system/scheduler/get $Scheduler ]; :local SchedulerVal [ /system/scheduler/get $Scheduler ];
@ -893,8 +888,6 @@
} }
} }
:if ([ :len $SourceNew ] = 0 && $ScriptUpdatesFetch = true) do={
:local ScriptInfo [ $ParseKeyValueStore ($ScriptVal->"comment") ];
:if (!($ScriptInfo->"ignore" = true)) do={ :if (!($ScriptInfo->"ignore" = true)) do={
:do { :do {
:local BaseUrl $ScriptUpdatesBaseUrl; :local BaseUrl $ScriptUpdatesBaseUrl;
@ -919,7 +912,6 @@
} }
} }
} }
}
:if ([ :len $SourceNew ] > 0) do={ :if ([ :len $SourceNew ] > 0) do={
:if ($SourceNew != $ScriptVal->"source") do={ :if ($SourceNew != $ScriptVal->"source") do={

View file

@ -23,6 +23,7 @@
107="Dropped support for non-fixed width font in Telegram notifications."; 107="Dropped support for non-fixed width font in Telegram notifications.";
108="Enhanced 'log-forward' to list log messages with colorful bullets to indicate severity."; 108="Enhanced 'log-forward' to list log messages with colorful bullets to indicate severity.";
109="Added support to send notifications via Ntfy (ntfy.sh)."; 109="Added support to send notifications via Ntfy (ntfy.sh).";
110="Dropped support for loading scripts from local storage.";
}; };
# Migration steps to be applied on script updates # Migration steps to be applied on script updates