From 2e1367ace67b8dcfb38745d9011fe4e2c0aa41d1 Mon Sep 17 00:00:00 2001 From: vados-dev <192440777+vados-dev@users.noreply.github.com> Date: Mon, 4 May 2026 10:25:04 +0300 Subject: [PATCH] Autocommit in repo: ros.vados.ru, generated by owner: root, in 10:25:03 04.05.2026. --- html/AM-GlobalFunc.rsc | 33 ++++----------------------------- 1 file changed, 4 insertions(+), 29 deletions(-) diff --git a/html/AM-GlobalFunc.rsc b/html/AM-GlobalFunc.rsc index fa4da0821..0b42a1519 100644 --- a/html/AM-GlobalFunc.rsc +++ b/html/AM-GlobalFunc.rsc @@ -6,7 +6,7 @@ # # requires RouterOS, version=7.19 # requires device-mode, fetch, scheduler -:local ExitOK false; + :local ScriptName [ :jobname ]; #:global checkRunJob $SriptName; #:global fixCRLF; @@ -17,12 +17,12 @@ :global GlobalFuncReady false; # Git commit id & info, expected configuration version -:global CommitId "main/539/f765de68"; +:global CommitId "main/540/0e7ad17d"; :global CommitTAG "unknown"; -:global CommitInfo "Autocommit in repo: ros.vados.ru, generated by owner: root, in 10:20:02 04.05.2026."; +:global CommitInfo "Autocommit in repo: ros.vados.ru, generated by owner: root, in 10:25:03 04.05.2026."; # The variables are received right here. -:global GlobalConfVersion 138; +:global GlobalConfVersion 140; :global SumsDirAndFileName "tmp/checksums.json"; @@ -556,15 +556,6 @@ :if ($Severity != "debug" || $Debug = true) do={:put ([ $PrintSeverity $Severity ] . ": " . $Message)} } -# check and download required certificate -# Description: This function checks if a certificate with given Common Name is available in the system or not. -# If not, it tries to download it from repository. It also checks the certificate chain and downloads missing intermediate certificates if needed. -# Arguments: "Common Name" - the common name of the certificate to check -# "fetch" - if the intended use for certificate is "fetch", it will check if the certificate is available for fetch option and return true if it is, otherwise it will check other options as well and return true if the certificate is available for at least one of the options. -# "tls" - if the intended use for certificate is "tls", it will check if the certificate is available for tls option and return true if it is, otherwise it will check other options as well and return true if the certificate is available for at least one of the options. -# "all" - if the intended use is "all", it will check all options and return true if the certificate is available for at least one of the options. -# "undefined" - if the intended use for certificate is not defined, it will check all options and log a warning as well. -# Usage: $CertificateAvailable "Common Name" "intended use for certificate (e.g. "fetch", "tls", "all", "undefined")" :set CertificateAvailable do={ :local CommonName [ :tostr $1 ]; :local UseFor [ :tostr $2 ]; @@ -617,15 +608,6 @@ :return true; } -# download and import certificate -# Description: This function downloads a certificate with given Common Name from repository and imports it to the system. -# It also checks the certificate chain and downloads missing intermediate certificates if needed from repository. -# If the certificate is already available, it does nothing. -# If the certificate is not available in repository, it attempts to download it from mkcert.org. -# If it is also not available there, it logs a warning and returns false. -# If the certificate is downloaded but still not available after import, it removes all certificates with the same Common Name and logs a warning, assuming the certificate was imported but not named properly. -# Or if there are multiple certificates with the same Common Name, it does nothing as well, assuming the certificate is already imported but not named properly. -# Usage: $CertificateDownload "Common Name" :set CertificateDownload do={ :local CommonName [ :tostr $1 ]; :global ScriptUpdatesBaseUrl; @@ -684,12 +666,6 @@ :return true; } -# name a certificate by its common-name -# Description: Some RouterOS functions require certificate name instead of common-name or fingerprint. -# This function finds a certificate by common-name, fingerprint or name and sets its name to a clean version of common-name -# (only letters, numbers and dashes, other chars are replaced with dash). -# If there are multiple certificates with the same common-name, it will rename the first one found and log a warning. -# Usage: $CertificateNameByCN "Common Name" :set CertificateNameByCN do={ :local Match [ :tostr $1 ]; :global CleanName; @@ -1740,7 +1716,6 @@ :if ([ :len [ /system/scheduler/find where name="AM-ScriptInstallUpdate" ] ] = 0) do={ /system/scheduler/add name="AM-ScriptInstallUpdate" comment=$Comment start-time=startup interval=1d on-event=$OnEvent; } - :log warning ("This script $ScriptName Loaded " . \ [ $IfThenElse ($CommitId != "unknown") ([ $CommitBrief ] . " ") ] . \ "on " . $devBoardName . "\nRouterOS: " . $devCurVersion . "\nArchitecture: " . $devCurArch . "\nIdentity: " . $Identity); -- 2.52.0