Quantcast
Channel: MikroTik
Viewing all articles
Browse latest Browse all 15133

Scripting • Need help with a script that fails on some routers

$
0
0
This is just part of a bigger script, but for some reason it starts to log error to the log when this part is run.

When cut/paste this to a terminal on a hex (750g3) router:
Code:
{: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]}}
I get the error marked in red:
[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] >
Even if this part give error message, rest of script runs fine. It may be a bug on one of my router.

Statistics: Posted by Jotne — Sun Feb 11, 2024 9:42 pm



Viewing all articles
Browse latest Browse all 15133

Trending Articles