Advertisement
sopyanx

tcdn.me

Feb 17th, 2020
1,289
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.69 KB | None | 0 0
  1. :do {
  2. :local LIST "browsec";
  3. :local DOMAIN "tcdn.me";
  4.  :foreach Crec in=[/ip dns cache all find where ( ( (type="A") || (type="CNAME") ) && (static=no) && (name~$DOMAIN) )] do={
  5.   :local Cname [/ip dns cache get number=$Crec name];
  6.   :local Cdata "";  
  7.   :delay 1000ms;
  8.   :if ([/ip dns cache all get $Crec type]="CNAME") do={
  9.    :set $Cdata [:resolve $Cname]; } else={
  10.    :set $Cdata [/ip dns cache get number=$Crec address]; }
  11.   :do {/ip firewall address-list
  12.    :do {
  13.    add list=$LIST address=$Cdata comment=$Cname disabled=no
  14. } on-error={
  15. :log warning message="address entry exist: List=$LIST , Host=$Cname , Address=$Cdata";}
  16.   }
  17.  }
  18. } on-error={:log error message="script failed..."}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement