From c05c3863b1a6a0faeeda22bb3461b3e0a242c8aa Mon Sep 17 00:00:00 2001 From: vados-dev <192440777+vados-dev@users.noreply.github.com> Date: Mon, 4 May 2026 19:35:04 +0300 Subject: [PATCH] Autocommit in repo: ros.vados.ru, generated by owner: root, in 19:35:03 04.05.2026. --- html/AM-GlobalFunc.rsc | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/html/AM-GlobalFunc.rsc b/html/AM-GlobalFunc.rsc index f42987296..231ac19e5 100644 --- a/html/AM-GlobalFunc.rsc +++ b/html/AM-GlobalFunc.rsc @@ -17,9 +17,9 @@ :global GlobalFuncReady false; # Git commit id & info, expected configuration version -:global CommitId "main/587/8420eba5"; +:global CommitId "main/588/3cafe107"; :global CommitTAG "unknown"; -:global CommitInfo "Autocommit in repo: ros.vados.ru, generated by owner: root, in 19:30:03 04.05.2026."; +:global CommitInfo "Autocommit in repo: ros.vados.ru, generated by owner: root, in 19:35:03 04.05.2026."; # The variables are received right here. :global GlobalConfVersion 140; @@ -1501,12 +1501,12 @@ :global CommentsInScripts; :if ([ $CertificateAvailable "Root YE" "fetch" ] = false) do={ - :log warning ($0 . "Downloading certificate failed, trying without."); + $LogPrint warning $0 ("Downloading certificate failed, trying without."); } :foreach Script in=$Scripts do={ :if ([ :len [ /system/script/find where name=$Script ] ] = 0) do={ - :log info ($0 . " Adding new script: " . $Script); + $LogPrint info $0 ("Adding new script: " . $Script); /system/script/add name=$Script owner=$Script source="#!rsc by Vados\n" comment=$NewComment; } } @@ -1755,8 +1755,18 @@ /system/scheduler/add name="AM-ScriptInstallUpdate" comment=$Comment start-time=startup interval=1d on-event=$OnEvent; } +:onerror Err { + :global GlobalConfReady; + :retry { :if ($GlobalConfReady != true) do={ :error ("Global configs not ready."); }; } delay=100ms max=5; + :log warning ("This script $ScriptName Loaded " . \ [ $IfThenElse ($CommitId != "unknown") ([ $CommitBrief ] . " ") ] . \ "on " . $devBoardName . "\nRouterOS: " . $devCurVersion . "\nArchitecture: " . $devCurArch . "\nIdentity: " . $Identity); -# signal we are ready + # signal we are ready :set GlobalFuncReady true; +:set ExitOK true; + +:log info ($0 . "Global configs ready!"); +} do={ + :global ExitOnError; $ExitOnError $0 $Err; +} -- 2.52.0