Skip to content

Instantly share code, notes, and snippets.

@deemru
Created July 13, 2018 08:39
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save deemru/a8b54aecd84c73cbe06359dcbca0f054 to your computer and use it in GitHub Desktop.
Save deemru/a8b54aecd84c73cbe06359dcbca0f054 to your computer and use it in GitHub Desktop.
MikroTik script to monitor one interface and turn off another
:local EthMonitor "ether3"
:local EthTurnOff "ether1"
:local EthTurnOffStatus [:interface ethernet get $EthTurnOff disabled]
/interface ethernet monitor $EthMonitor once do={
:if ($status = "link-ok" && $EthTurnOffStatus ) do={ /interface ethernet set $EthTurnOff disabled=yes }
:if ($status != "link-ok" && !$EthTurnOffStatus ) do={ /interface ethernet set $EthTurnOff disabled=no }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment