Ad Code

Responsive Advertisement

Script Merubah Dynamic Adress List menjadi Static Adress List


/system scheduler add interval=30m name=Dynamic2Static on-event=Dynamic2StaticAddressLists policy=ftp,reboot,read,write,policy,test,password,sniff,sensitive,romon start-date=jun/30/2021 start-time=21:06:00
/system script add dont-require-permissions=no name=Dynamic2StaticAddressLists owner=admin policy=ftp,reboot,read,write,policy,test,password,sniff,sensitive,romon source="# Convert dynamic to static in address-lists so dynamic records do not get deleted after a router reboot.\r\
\n:local comment\r\
\n:local address\r\
\n:local list\r\
\n:local disabled\r\
\n:local found \r\
\n\r\
\n:set found 0;\r\
\n\r\
\n/ip firewall address-list\r\
\n:foreach a in=[find] do={\r\
\n :if ([get \$a dynamic] = true) do={ \r\
\n /system logging disable 0\r\
\n :set found 1;\r\
\n :set comment [get \$a comment]\r\
\n :set address [get \$a address]\r\
\n :set list [get \$a list]\r\
\n :set disabled [get \$a disabled]\r\
\n remove \$a\r\
\n add address=\$address list=\$list comment=\$comment disabled=\$disabled \r\
\n }\r\
\n}\r\
\n:if (\$found=1) do={\r\
\n/system logging enable 0\r\
\n:log info \"Dynamic to static conversion finished. System logging enabled.\"\r\
\n:set found 0;\r\
\n}"
/t
Close Menu