When cut/paste this to a terminal on a hex (750g3) router:
Code: Select all
{
:local CmdHistory true
:local train [:tonum [:pick [/system resource get version] 0 1]]
:if ($train > 6 and $CmdHistory) do={
:global cmd
:local f 0
:foreach i in=[/system history find] do={
:if ($i = $cmd) do={ :set f 1 }
:if ($f != 1) do={
:put "StartCMD"
:put [/system history get $i]
:put "EndCMD"
}
}
:global cmd [:pick [/system history find] 0]
}
}
Even if this part give error message, rest of script runs fine. It may be a bug on one of my router.[admin@750] > {
{... :local CmdHistory true
{... :local train [:tonum [:pick [/system resource get version] 0 1]]
{...
{... :if ($train > 6 and $CmdHistory) do={
{{... :global cmd
{{... :local f 0
{{... :foreach i in=[/system history find] do={
{{{... :if ($i = $cmd) do={ :set f 1 }
{{{... :if ($f != 1) do={
{{{{... :put "StartCMD"
{{{{... :put [/system history get $i]
{{{{... :put "EndCMD"
{{{{... }
{{{... }
{{... :global cmd [:pick [/system history find] 0]
{{... }
{... }
interrupted
error - contact MikroTik support and send a supout file (10)
[admin@750] >