Page 1 of 1

Script fails on 6.34, works on 6.28

Posted: Mon Mar 20, 2017 9:31 pm
by gtpro
Hello, I am using the following script on 6.28:

:foreach i in=[/tool user-manager user find] do={:if ([/tool user-manager user get $i uptime-used]= 1h) do={
:log warning ("Delete user... $[/tool user-manager user get $i name]")
/tool user-manager user remove [/tool user-manager user get $i name]
}
}

But this same script does not work on 6.34.1

Any one know how to fix it for 6.34.1?. Thanks.

Re: Script fails on 6.34, works on 6.28

Posted: Mon Mar 20, 2017 11:28 pm
by gtpro
Found the solution!

:foreach i in=[/tool user-manager user find] do={:if ([/tool user-manager user get $i uptime-used]=1h) do={
:log warning ("Delete user... $[/tool user-manager user get $i user]")
/tool user-manager user remove [/tool user-manager user get $i user]
}
}

So all I had to change was "name" to "user". I hope it helps others.

Re: Script fails on 6.34, works on 6.28

Posted: Tue Mar 21, 2017 1:46 pm
by HarBenly
Thanks man! just the simple change and yes its working. This thread was very helpful

Re: Script fails on 6.34, works on 6.28

Posted: Wed Mar 22, 2017 1:44 am
by gtpro
Good!