Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #WAN1 - 1
- {
- :local rmark "WAN1"
- :local count [/ip route print count-only where comment="WAN1-TESTE"]
- :if ($bound=1) do={
- :if ($count = 0) do={
- /ip route add dst-address=8.8.8.8 gateway=$"gateway-address" comment="WAN1-TESTE"
- } else={
- :if ($count = 1) do={
- :local test [/ip route find where comment="WAN1-TESTE"]
- :if ([/ip route get $test gateway] != $"gateway-address") do={
- /ip route set $test gateway=$"gateway-address"
- }
- } else={
- :error "Multiple routes found"
- }
- }
- } else={
- /ip route remove [find comment="WAN1-TESTE"]
- }
- }
- #Netwatch - usar no Down
- log error "WAN-1 caiu"
- /ip dhcp-cl set add-def=no [find comment="WAN1"]
- /tool e-mail send to=" leonardo@contractti.com.br" subject="O Link do ISP-1 caiu - Abrir chamado"
- #Usar no UP
- log error "WAN-1 Voltou"
- /ip dhcp-cl set add-def=yes [find comment="WAN1"]
- /tool e-mail send to=" leonardo@contractti.com.br" subject="O Link do ISP-1 Voltou - Encerrar chamado"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement