Created
December 21, 2023 14:48
-
-
Save Tommasov/836476858ed384ed609d4aff1778f5a0 to your computer and use it in GitHub Desktop.
Mikrotik Netwatch status "Test"
This file contains 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
:global timeoutLTE 60 | |
:local i 0 | |
:local isLTEinit false | |
:while ($i<$timeoutLTE) do={ | |
:foreach n in=[/interface lte find] do={:set $isLTEinit true} | |
:if ($isLTEinit=true) do={ | |
:set $i $timeoutLTE | |
} | |
:set $i ($i+1) | |
:delay 1s | |
} | |
:if ($isLTEinit=true) do={ | |
#:log info "(Netwatch) Tutto ok"; | |
} else={ | |
:log error "(Netwatch) Modem crashed. Reboot."; | |
/system reboot | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment