Tacoen's shared code-snipsets
:global wan0Stat :global wan1Stat :global wan0LastStat :global wan1LastStat :global LastUseBalance /global UseBalance false /log info "[+] Netstatus-routine" :if ($wan0Stat = "UP" and $wan0LastStat="DOWN") do={ /system script run set-wan0-up } :if ($wan0Stat = "DOWN") do={ /system script run set-wan0-down } :if ($wan1Stat = "UP" and $wan1LastStat="DOWN") do={ /system script run set-wan1-up } :if ($wan1Stat = "DOWN") do={ /system script run set-wan1-down } :if ($wan0Stat = "UP" and $wan1Stat = "UP") do={ /global UseBalance true } :if ($UseBalance = true and $LastUseBalance = false) do={ /system script run nthbalance-up } :if ($UseBalance=false) do={ /system script run nthbalance-down } /log info "NetStatus | wan0: $wan0Stat" /log info "NetStatus | wan1: $wan1Stat" /log info "NetStatus | UseBalance: $UseBalance"
Label: mikrotik