Advertisement
mcesar

Untitled

Oct 16th, 2019
120
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.11 KB | None | 0 0
  1. #WAN1 - 1
  2.  
  3. {
  4. :local rmark "WAN1"
  5. :local count [/ip route print count-only where comment="WAN1-TESTE"]
  6. :if ($bound=1) do={
  7. :if ($count = 0) do={
  8. /ip route add dst-address=8.8.8.8 gateway=$"gateway-address" comment="WAN1-TESTE"
  9. } else={
  10. :if ($count = 1) do={
  11. :local test [/ip route find where comment="WAN1-TESTE"]
  12. :if ([/ip route get $test gateway] != $"gateway-address") do={
  13. /ip route set $test gateway=$"gateway-address"
  14. }
  15. } else={
  16. :error "Multiple routes found"
  17. }
  18. }
  19. } else={
  20. /ip route remove [find comment="WAN1-TESTE"]
  21. }
  22. }
  23.  
  24.  
  25. #Netwatch - usar no Down
  26. log error "WAN-1 caiu"
  27. /ip dhcp-cl set add-def=no [find comment="WAN1"]
  28. /tool e-mail send to=" leonardo@contractti.com.br" subject="O Link do ISP-1 caiu - Abrir chamado"
  29.  
  30. #Usar no UP
  31. log error "WAN-1 Voltou"
  32. /ip dhcp-cl set add-def=yes [find comment="WAN1"]
  33. /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