From d58e450b31f6eddde2136e09a081433dc3bb073b Mon Sep 17 00:00:00 2001 From: vados-dev <192440777+vados-dev@users.noreply.github.com> Date: Mon, 4 May 2026 09:55:03 +0300 Subject: [PATCH] Autocommit in repo: ros.vados.ru, generated by owner: root, in 09:55:03 04.05.2026. --- html/AM-GlobalFunc.rsc | 34 ++++++++++++++++------------------ 1 file changed, 16 insertions(+), 18 deletions(-) diff --git a/html/AM-GlobalFunc.rsc b/html/AM-GlobalFunc.rsc index ee69d7d12..07fe1446c 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/535/47072049"; +:global CommitId "main/536/3e6969a3"; :global CommitTAG "unknown"; -:global CommitInfo "Autocommit in repo: ros.vados.ru, generated by owner: root, in 09:35:03 04.05.2026."; +:global CommitInfo "Autocommit in repo: ros.vados.ru, generated by owner: root, in 09:55:03 04.05.2026."; # The variables are received right here. :global GlobalConfVersion 138; @@ -713,7 +713,7 @@ } :set FetchHuge do={ - :local ScriptName [ :tostr $1 ]; + :local FHScript [ :tostr $1 ]; :local Url [ :tostr $2 ]; :local CheckCert [ :tostr $3 ]; @@ -728,7 +728,7 @@ :global WaitForFile; :set CheckCert [ $IfThenElse ($CheckCert = "false") "no" "yes-without-crl" ]; - :local DirName ("tmpfs/" . [ $CleanName $ScriptName ]); + :local DirName ("tmpfs/" . [ $CleanName $FHScript ]); :if ([ $MkDir $DirName ] = false) do={ :log error ($0 . " Failed creating directory!"); :return false; @@ -736,7 +736,7 @@ :local FileName ($DirName . "/" . [ $CleanName $0 ] . "-" . [ $GetRandom20CharAlNum ]); :onerror Err { /tool/fetch check-certificate=$CheckCert $Url dst-path=$FileName \ - http-header-field=({ [ $FetchUserAgentStr $ScriptName ] }) as-value; + http-header-field=({ [ $FetchUserAgentStr $FHScript ] }) as-value; } do={ :if ([ $WaitForFile $FileName 500ms ] = true) do={ $RmFile $FileName; @@ -1714,8 +1714,9 @@ :set GlobalConfChanges; :set GlobalConfMigration; } -} do={:global ExitOnError; $ExitOnError $0 $Err} -} +} do={ + :global ExitOnError; $ExitOnError $0 $Err; +} } # Add and fix global scheduler :put "Add or/and fix Global scheduler..."; @@ -1738,21 +1739,18 @@ /system/scheduler/add name="AM-ScriptInstallUpdate" comment=$Comment start-time=startup interval=1d on-event=$OnEvent; } -#:local Resource [ /system/resource/get ]; -#:log info ($ScriptName . " Loaded on " . $Resource->"board-name" . " with RouterOS " . $Resource->"version" . " and Architecture " ."."); - :onerror Err { :global GlobalConfReady; - :retry { :if ($GlobalConfReady != true) do={ :error ("Global configs not ready."); }; } delay=100ms max=5; + :retry { :if ($GlobalConfReady != true) \ + do={ :error ("Global config not ready."); }; } delay=500ms max=50; -# signal we are ready -:set GlobalFuncReady true; -:set ExitOK true; :log warning ("This script $ScriptName Loaded " . \ [ $IfThenElse ($CommitId != "unknown") ([ $CommitBrief ] . " ") ] . \ "on " . $devBoardName . "\nRouterOS: " . $devCurVersion . "\nArchitecture: " . $devCurArch . "\nIdentity: " . $Identity); -} do={:global ExitOnError; $ExitOnError $0 $Err;} -#} do={:global ExitError; $ExitError $ExitOK [ :jobname ] $Err} -# log the successful load of the script, or an error if it failed -#:if ([$GlobalFuncReady] = true && [$GlobalConfReady] = true) do={ +# signal we are ready +:set GlobalFunctionsReady true; + +} do={ + :global ExitOnError; $ExitOnError $0 $Err; +} -- 2.52.0