load-net

remove_5060_firewall_connection

Mar 31st, 2024
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.57 KB | None | 0 0
  1. :global internetStatus;
  2. :global previousInternetStatus
  3. :global internetCheckAddress;
  4. :set value="8.8.8.8" name=$internetCheckAddress;
  5. :set $ui "offline"
  6. :if ([/ping $internetCheckAddress count=1] = 0) do={
  7. :set $internetStatus "offline"
  8. :set $ui "offline"
  9. } else={
  10. :set $internetStatus "online";
  11. :set $uiu "online"
  12. }
  13. if ( $uiu != $previousInternetStatus ) do={
  14. :log info "Clearing connections ";
  15. :foreach i in=[/ip firewall connection find dst-address~":5060" protocol~"udp"] do={ /ip firewall connection remove $i }
  16. }
  17. :set previousInternetStatus $internetStatus;
Advertisement
Add Comment
Please, Sign In to add comment