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

index 0b42a1519d4b673283f8c98452dee0d0157d922f..93a540dca8b2b36ae3e7342395dc6f3ae67b735b 100644 (file)
@@ -17,9 +17,9 @@
 :global GlobalFuncReady false;
 
 # Git commit id & info, expected configuration version
-:global CommitId "main/540/0e7ad17d";
+:global CommitId "main/541/2e1367ac";
 :global CommitTAG "unknown";
-:global CommitInfo "Autocommit in repo: ros.vados.ru, generated by owner: root, in 10:25:03 04.05.2026.";
+:global CommitInfo "Autocommit in repo: ros.vados.ru, generated by owner: root, in 10:30:02 04.05.2026.";
 
 # The variables are received right here.
 :global GlobalConfVersion 140;
 :global VersionToNum;
 :global RequiredRouterOS;
 
-:global FetchHuge;
 :global FetchUserAgentStr;
 :global CertificateAvailable;
 :global CertificateDownload;
   :return $Return;
 }
 
-:set FetchHuge do={
-  :local FHScript [ :tostr $1 ];
-  :local Url        [ :tostr $2 ];
-  :local CheckCert  [ :tostr $3 ];
-
-  :global CleanName;
-  :global FetchUserAgentStr;
-  :global GetRandom20CharAlNum;
-  :global IfThenElse;
-  :global LogPrint;
-  :global MkDir;
-  :global RmDir;
-  :global RmFile;
-  :global WaitForFile;
-
-  :set CheckCert [ $IfThenElse ($CheckCert = "false") "no" "yes-without-crl" ];
-  :local DirName ("tmpfs/" . [ $CleanName $FHScript ]);
-  :if ([ $MkDir $DirName ] = false) do={
-    :log error ($0 . " Failed creating directory!");
-    :return false;
-  }
-  :local FileName ($DirName . "/" . [ $CleanName $FHScript ] . "-" . [ $GetRandom20CharAlNum ]);
-  :do {
-    /tool/fetch check-certificate=$CheckCert $Url dst-path=$FileName \
-      http-header-field=({ [ $FetchUserAgentStr $FHScript ] }) as-value;
-  } on-error={
-    :if ([ $WaitForFile $FileName 500ms ] = true) do={
-      $RmFile $FileName;
-    }
-    :log debug ($0 . " Failed downloading from " . $Url . " - " . $Err);
-    $RmDir $DirName;
-    :return false;
-  }
-  :if ([ $WaitForFile $FileName 5s ] = false) do={
-    :log debug ($0 . " The file downloaded from " . $Url . " did not show up.");
-    $RmDir $DirName;
-    :return false;
-  }
-  :local FileSize [ /file/get $FileName size ];
-  :local Return "";
-  :local VarSize 0;
-  :while ($VarSize != $FileSize) do={
-    :set Return ($Return . ([ /file/read offset=$VarSize chunk-size=32768 file=$FileName as-value ]->"data"));
-    :set FileSize [ /file/get $FileName size ];
-    :set VarSize [ :len $Return ];
-    :if ($VarSize > $FileSize) do={
-      :delay 100ms;
-    }
-  }
-  $RmFile $FileName;
-  $RmDir $DirName;
-  :return $Return;
-}
-
 :set FetchUserAgentStr do={
   :local Caller [ :tostr $1 ];