]> Git [git.vados.ru] :: Repos - Mikrotiks/ros.vados.ru.git/commitdiff
Auto-commit: AM-GlobalFunc.rsc manual update on 4/30/2026, 2026-04-30T18:39:52.295Z
authorvados-dev <192440777+vados-dev@users.noreply.github.com>
Thu, 30 Apr 2026 18:39:52 +0000 (21:39 +0300)
committervados-dev <192440777+vados-dev@users.noreply.github.com>
Thu, 30 Apr 2026 18:39:52 +0000 (21:39 +0300)
html/AM-GlobalFunc.rsc

index 4f7512e05a3666087c3adbb7baf0c07ad6986c24..5f97649ee216920d809bfaaede8e09f23528ba77 100644 (file)
        :retry command={:set PubIpAddr ([ /tool/fetch http-method="get" check-certificate=yes-without-crl $Url output=user as-value ]->"data")} \
         delay=200ms max=5 on-error={:log error ($JobName . " Failed to detect public IP using fallback service: " . $Url . ".")}
     };
-    :if ($PubIpAddr = false) do={:set PubIpAddr "not-detected"} else={:set PubIpAddr [:pick $PubIpAddr 0 15]}
-  :return $PubIpAddr;
+    :local IpLen ([ :len $PublicIpAddress ] -1);
+    :if ($PubIpAddr = false) do={:set PubIpAddr "not-detected"} else={:set PubIpAddr [:pick $PubIpAddr 0 $IpLen]}
+#    :log warning ($0 . " Public IP address detected: $PubIpAddr");
+    :return $PubIpAddr;
 }
 
 :set FormatLine do={