: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;
+}