Script only once

Hi there!


/interface ethernet monitor ether1 once do={
:if ($rate = "10Mbps") do={

/export file=email
/tool e-mail send \
to="abc@email.com" from=user@email.com \
subject=([/system identity get name] . " ALERT - LAN") \
 server=1.1.2.2

}
}

i’ve done this script and everything works so fine
a schedule notice me every 10 minutes if the eth1 is 10mb or 100mb

what i wonna add, if this shoulda not spam my mail once the condition is matched.
So, check every 10 minutes. If my lan is 100mb is ok, if not send an email. After 10 mins if that lan is 10mb again, don’t send me any mail

hope to be clear

thx!

Use a global variable (like “lastRate”).
In your script, send the mail only if $rate is different than $lastRate
And of course don’t forget to update $lastRate when the rate changes