]> Git [git.vados.ru] :: Repos - Mikrotiks/ros.vados.ru.git/commitdiff
Autocommit in repo: ros.vados.ru, generated by owner: root, in 19:35:03 04.05.2026.
authorvados-dev <192440777+vados-dev@users.noreply.github.com>
Mon, 4 May 2026 16:35:04 +0000 (19:35 +0300)
committervados-dev <192440777+vados-dev@users.noreply.github.com>
Mon, 4 May 2026 16:35:04 +0000 (19:35 +0300)
html/AM-GlobalFunc.rsc

index f42987296943bb4c5c3021baedbdf4ac6bb28168..231ac19e578d25c27e5a0a8badb436121211fa0b 100644 (file)
@@ -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;
   :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;
     }
   }
 /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;
+}