# Global Url For Amster scripts to fetch
# most be defined in AM-Init-Script or AM-setup scripts
:global GlobalScriptsUrl "https://ros.vados.ru/";
-:global ScriptsUrlSuffix "";
+:global ScriptsUrlSuffix (a);
:global CheckSumsVerify true;
:global ScriptUpdatesCRLF true;
:global CertRenewUrl ($GlobalScriptsUrl . "certs/" . $Identity . "/");
:global CertRenewTime 2w;
-:global CertRenewPass {
- "";
+:global CertRenewPass (a); #{
+# "";
# "v3ry-s3cr3t";
# "4n0th3r-s3cr3t";
-};
+#};
:global CertWarnTime 1w;
-:global CertIssuedExportPass {
- "";
+:global CertIssuedExportPass (a); # {
+# "";
# "cert1-cn"="v3ry-s3cr3t";
# "cert2-cn"="4n0th3r-s3cr3t";
-};
+#};
# Script BackupAndUpdate mode, possible values: backup,
# updateOnce - Update once as "osnotify" and back "osnotify" mode (in terminal run :set OSUpdateMode updateOnce; $OSUpdateMode;).
:global GlobalFuncReady false;
# Git commit id & info, expected configuration version
-:global CommitId "main/618/22f80b83";
+:global CommitId "main/619/a99e710a";
:global CommitTAG "unknown";
-:global CommitInfo "Autocommit in repo: ros.vados.ru, generated by owner: root, in 01:25:02 05.05.2026.";
+:global CommitInfo "Autocommit in repo: ros.vados.ru, generated by owner: root, in 01:30:03 05.05.2026.";
# The variables are received right here.
:global GlobalConfVersion 140;
:return true;
}
-# read parts of a large file
-# Description of parameters:
-# $1 - script name for logging and user agent
-# $2 - url to fetch from
-# $3 - check-certificate value for /tool/fetch (true/false)
-# $4 - mode value for /tool/fetch (optional, e.g. "keep-broken", "https-only", "http-only"
-# "no-redirects", "background", "background-and-keep-broken", "background-and-https-only",
-# "background-and-http-only", "background-and-no-redirects", "background-and-keep-broken-and-https-only", "background-and-keep-broken-and-http-only",
-# "background-and-keep-broken-and-no-redirects")
-# $5 - fetch method for /tool/fetch (optional, e.g. "get", "head", "post", "put", "patch", "delete")
-#:set FetchLargeFiles do={
-# :local RunName [:tostr $1];
-# :local fetchUrl [:tostr $2];
-# :local fetchFile [:tostr $3];
-# :local CheckCert [:tostr $4];
-# :local fetchMode [:tostr $5];
-# :local fetchMethod [:tostr $6];
-# :local tmpName;
-# :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" ];
-#
-# :set tmpName ($CleanName "tmp-" . [ $GetRandom20CharAlNum 6 ]);
-# :local DirName ("tmpfs/" . $tmpName);
-# :if ([ $MkDir $DirName ] = false) do={
-# :log error ($RunName . " Failed creating directory: " . $DirName . "!");
-# :return false;
-# }
-#
-# :local FileName ($DirName . "/" . [ $CleanName $fetchFile ] . "-" . [ $GetRandom20CharAlNum 5 ]);
-# :local Url ($fetchUrl . $fetchFile);
-# :onerror Err {
-# /tool/fetch check-certificate=$CheckCert $Url dst-path=$FileName \
-# http-header-field=({ [ $FetchUserAgentStr $RunName ] }) as-value;
-# } do={
-# :if ([ $WaitForFile $FileName 500ms ] = true) do={
-# $RmFile $FileName;
-# }
-# :log error ($RunName . " Failed downloading from '" . $Url . "' - " . $Err);
-# $RmDir $DirName;
-# :return false;
-# }
-#
-# :if ([ $WaitForFile $FileName 5s ] = false) do={
-# :log error ($RunName . " The file downloaded from '" . $Url . "' did not show up.");
-# :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 FetchHugeFiles do={
:local ScriptName [ :tostr $1 ];
:local Url [ :tostr $2 ];
[ $SymbolForNotification "pushpin" "*" ] . $Change);
$LogPrint info $0 ("Change " . $I . ": " . $Change);
}
- } else={:set NotificationMessage ($NotificationMessage . "\n\nNews and changes are not available.")}
+ } else={
+ :set NotificationMessage ($NotificationMessage . "\n\nNews and changes are not available.");
+
+ }
- :set GlobalConfChanges;
- :set GlobalConfMigration;
+ :if ([ :len $GlobalConfChanges ] > 0) do={ :set GlobalConfChanges; } else={ :global GlobalConfChanges (a); }
+ :if ([ :len $GlobalConfMigration ] > 0) do={ :set GlobalConfMigration; } else={ :global GlobalConfMigration (a); }
}
} do={
:global ExitOnError; $ExitOnError $0 $Err;