Script Gatilho
####Lembrar de deixar o IP comentado como "GATILHO" na lista dos address #### /system script add name=gatilho1 owner=admin policy=ftp,reboot,read,write,policy,test,password,sniff,sensitive source="/interface ethernet monitor [[Nome exato da Interface onde ira ligar o gatilho (EX: ether7-gatilho)]] once do={\r\ \n:if (\$status = \"link-ok\") do={\r\ \n }\r\ \n:if (\$status != \"link-ok\") do={\r\ \n /system script run gatilho2\r\ \n }\r\ \n}" add name=gatilho2 owner=admin policy=ftp,reboot,read,write,policy,test,password,sniff,sensitive source="/ip address set [find comment=GATILHO] disabled=yes\r\ \n/system scheduler disable gatilho-up\r\ \n/system scheduler enable gatilho-down\r\ \n" add name=gatilho3 owner=admin policy=ftp,reboot,read,write,policy,test,password,sniff,sensitive source="/interface ethernet monitor [[Nome exato da Interface onde ira ligar o gatilho (EX: ether7-gatilho)]] once do={\r\ \n:if (\$status != \"link-ok\") do={\r\ \n }\r\ \n:if (\$status = \"link-ok\") do={\r\ \n /system script run gatilho4\r\ \n }\r\ \n}\r\ \n" add name=gatilho4 owner=admin policy=ftp,reboot,read,write,policy,test,password,sniff,sensitive source="/ip address set [find comment=GATILHO] disabled=no\r\ \n/system scheduler disable gatilho-down\r\ \n/system scheduler enable gatilho-up\r\ \n\r\ \n" /system scheduler add interval=[[Intervalo de execução do script (em minutos)]]m name=gatilho-up on-event=gatilho1 policy=ftp,reboot,read,write,policy,test,password,sniff,sensitive start-date=jan/01/1970 start-time=13:34:01 add disabled=yes interval=[[Intervalo de execução do script (em minutos)]]m name=gatilho-down on-event=gatilho3 policy=ftp,reboot,read,write,policy,test,password,sniff,sensitive start-date=jan/01/1970 start-time=13:34:01



Nome exato da Interface onde ira ligar o gatilho (EX: ether7-gatilho):
Intervalo de execução do script (em minutos):


Use this code to post the full script to your own page:



Use this code to post only the variables to your own page: