selanjutnya mari kita buat script beikut
CODE :
/system clock manual set dst-delta=+07:00 dst-end="jan/01/1970 00:00:00" dst-start=\ "jan/01/1970 00:00:00" time-zone=+07:00 /system ntp client set enabled=yes mode=unicast primary-ntp=202.134.1.10 secondary-ntp=\ 152.118.24.8 /system scheduler add comment="" disabled=no interval=10s name=Check_Proxy on-event=PROXY \ policy=reboot,read,write,policy,test,password,sniff,sensitive start-date=\ jan/01/1970 start-time=00:00:00 /system script add name=Check-proxy policy=\ ftp,reboot,read,write,policy,test,winbox,password,sniff,sensitive source="\ {\r\ \n:local checkpage \"test.txt\";\r\ \n:local found \"0\" ;\r\ \n:foreach i in=[/file find] do={\r\ \n:local filename [/file get \$i name];\r\ \n:if ( \$filename = \$checkpage) do={ \r\ \n:set found \"1\" ; \r\ \n:log info \"found\"; \r\ \n}\r\ \n}\r\ \n:log warning \"\$found\";\r\ \n:if ( \$found = \"0\" ) do={ \r\ \n:log warning \"Disable rule, service down\"; \r\ \n/ip fire nat dis 3 ; \r\ \n/ip fire mang dis 14; \r\ \n} else={ \r\ \n:log info \"Enable rule, service up\"; \r\ \n/ip fire nat en 3; \r\ \n/ip fire mang en 14; \r\ \n}\r\ \n/file remove \$checkpage;\r\ \n}\r\ \n" untuk yg saya bold dan warna merah itu sesuaikan dengan nat atau mangle yg ingin anda disable atau enable
0 komentar:
Posting Komentar