Anyone have a script handy that can flash a led on a 433/493/750 when it sees a default route installed?
This script might help you get started. It counts the number of all routes. If the number goes up, it lights up leds and has a high beep. If the count goes down, it has a low beep. You can change it as you wish. Add a schedule to run the script however often you want.
# Detect when number of routes changes
# Tested on RouterOS v5.7
# set our global route count variable
:global lastRouteCount;
# get the current number of routes
:local currentRouteCount [ :len [/ip route find] ];
# if our global route count has never been set, set it now
:if ( [ :len $lastRouteCount ] < 1 ) do={
:set lastRouteCount $currentRouteCount ;
} else={
# if the last count was less than the current, number of routes has increased
:if ( $lastRouteCount < $currentRouteCount ) do={
# light up leds
:led user-led=yes;:led led1=yes;:delay 100ms;:led led2=yes;:delay 100ms;:led led3=yes;:delay 100ms;:led led4=yes;:delay 100ms;:led led5=yes;:delay 100ms;:led user-led=no;:delay 100ms;:led led1=no;:delay 100ms;:led led2=no;:delay 100ms;:led led3=no;:delay 100ms;:led led4=no;:delay 100ms;:led led5=no;
# high beep
:beep length=100ms frequency=5000;
}
# if the last count was more than the current, number of routes has decreased
:if ( $lastRouteCount > $currentRouteCount ) do={
# low beep
:beep length=100ms frequency=500;
}
# update the count
:set lastRouteCount $currentRouteCount;
}