Created
July 13, 2018 08:39
-
-
Save deemru/a8b54aecd84c73cbe06359dcbca0f054 to your computer and use it in GitHub Desktop.
MikroTik script to monitor one interface and turn off another
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
: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