:local email
:set email "error@error.error"
:if ([/ping 1.2.3.4 count=10] = 0) \
do {
:if ($gw = 1 || $gw = 2) \
do {
tool e-mail send to=$email \
subject ("Cas:" . [/system clock get time] . "/GW KO!")
:log error ("GW KO!")
/ip route {enable [find comment=BACKUP]}
}
:set gw 0
} \
else {
:if ($gw = 0 || $gw = 2) \
do {
tool e-mail send to=$email \
subject ("Cas:" . [/system clock get time] . "/GW OK!")
:log error ("GW OK!")
/ip route {disable [find comment=BACKUP]}
}
:set gw 1
}
a zadefinovat do globalnych premennych a vytvorit routu s comentarom BACKUP a mozno par dalsich drobnosti...