Skip to content

Instantly share code, notes, and snippets.

@Tommasov
Created December 21, 2023 14:48
Show Gist options
  • Save Tommasov/836476858ed384ed609d4aff1778f5a0 to your computer and use it in GitHub Desktop.
Save Tommasov/836476858ed384ed609d4aff1778f5a0 to your computer and use it in GitHub Desktop.
Mikrotik Netwatch status "Test"
: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