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

index abacf5ecb2a57d1a286a81725ef09b816e2797e6..1b743a653f824c541378f118005df3752c6a5974 100644 (file)
@@ -17,9 +17,9 @@
 :global GlobalFuncReady false;
 
 # Git commit id & info, expected configuration version
-:global CommitId "main/610/618e021b";
+:global CommitId "main/611/a8abd15c";
 :global CommitTAG "unknown";
-:global CommitInfo "Autocommit in repo: ros.vados.ru, generated by owner: root, in 00:30:03 05.05.2026.";
+:global CommitInfo "Autocommit in repo: ros.vados.ru, generated by owner: root, in 00:35:02 05.05.2026.";
 
 # The variables are received right here.
 :global GlobalConfVersion 140;
index 02e4482a6965cffe57a06f009c72743755fb22a3..27bb18688fdd2df48a8c68d283b71af4bfeb7e0b 100644 (file)
@@ -38,48 +38,38 @@ while (!$dnsLookupReady) do={ :nothing; }
 
 :local ListRKN "FuckRKN";
 :local ListComment ("ListRKN managed by " . $ScriptName);
-
 :foreach aListItem in=[/ip/firewall/address-list find list=$ListRKN] do={
     /ip firewall address-list remove $aListItem;
 }
-
 :foreach aItem in=$arrRKN do={
-#force the dns entries to be cached
     :do {
         :resolve $aItem;
     } on-error={
-        :log error "dns resolve failure [ ip - resolve ip ]"
+        :log error "dns resolve failure [ ip - resolve ip ]";
     }
-
     :foreach dnsRecord in=[/ip dns cache all find where (name=$aItem)] do={
-#if it's an A records add it directly
         :if ([/ip dns cache all get $dnsRecord type]="A") do={
             :local newAddress [/ip dns cache all get $dnsRecord data];
             :do {
                 /ip firewall address-list add list=$ListRKN address=$newAddress comment=$aItem;
             } on-error={
-                :log error "error when adding ip to list: $newAddress"
+                :log error "error when adding ip to list: $newAddress";
             }
         }
-
-#if it's a CNAME follow it until we get A records
         :if ([/ip dns cache all get $dnsRecord type]="CNAME") do={
             :local cname;
-            :local nextCname
+            :local nextCname;
             :set cname [/ip dns cache all find where (name=$aItem && type="CNAME")];
             :set nextCname [/ip dns cache all find where (name=[/ip dns cache all get $cname data] && type="CNAME")];
-
             :while ($nextCname != "") do={
                 :set cname $nextCname;
                 :set nextCname [/ip dns cache all find where (name=[/ip dns cache all get $cname data] && type="CNAME")];
             }
-            
-#add the a records we found
             :foreach aRecord in=[/ip dns cache all find where (name=[/ip dns cache all get $cname data] && type="A")] do={
                 :do {
                     /ip firewall address-list add list=$ListRKN address=[/ip dns cache all get $aRecord data] comment=$aItem;
                 } on-error={
-                    :log error "error when adding ip to list: $newAddress"
+                    :log error "error when adding ip to list: $newAddress";
                 }
             }
         }
@@ -88,6 +78,6 @@ while (!$dnsLookupReady) do={ :nothing; }
 
 :if ([ :len [ /system/scheduler/find where name=$ScriptName ] ] = 0) do={
    :log error ($ScriptName . "System Scheduler for script: " . $ScriptName . " is NOT SET! Fix It Now!");
-    /system/scheduler/add name=$ScriptName on-event="/system/script { run $ScriptName; }" comment="Update RKN DNS Looup" interval=20m policy=ftp,reboot,read,write,policy,test,password,sniff,sensitive,romon; start-time=[/system/clock/get date]; 
+    /system/scheduler/add name=$ScriptName on-event="/system/script { run $ScriptName; }" comment="Update RKN DNS Looup" interval=00:20:00 policy="ftp,reboot,read,write,policy,test,password,sniff,sensitive,romon" start-time=startup;
   }
 :set dnsLookupReady true;