Hi
I need a script in such a way that when the interface is out of run mode, it will be in run mode again with enable, and this script will be checked every minute.
mikrotik ver : 7.7
Really? Can't believe it ...Sample code generated by ChatGBT:...
:global ifstatus
:if ([/interface ethernet get ether1 running]=true) do={
:put "running"
:if ($ifstatus="down") do={
:put "changed to up"
}
:set $ifstatus "up"
} else={
:put "not running"
:if ($ifstatus="up") do={
:put "changed to down"
}
:set $ifstatus "down"
}
i running l2tp ethernettry this:
Code: Select all:global ifstatus :if ([/interface ethernet get ether1 running]=true) do={ :put "running" :if ($ifstatus="down") do={ :put "changed to up" } :set $ifstatus "up" } else={ :put "not running" :if ($ifstatus="up") do={ :put "changed to down" } :set $ifstatus "down" }
This script was tested. When Ether exits the run mode, it does not run again, even though the script counts.i running l2tp ethernettry this:
Code: Select all:global ifstatus :if ([/interface ethernet get ether1 running]=true) do={ :put "running" :if ($ifstatus="down") do={ :put "changed to up" } :set $ifstatus "up" } else={ :put "not running" :if ($ifstatus="up") do={ :put "changed to down" } :set $ifstatus "down" }
change ethernet to l2tp ethernet ?