Community discussions

MikroTik App
 
sewlist
Frequent Visitor
Frequent Visitor
Topic Author
Posts: 70
Joined: Fri Jun 02, 2006 3:48 pm

command substitution for one liner

Wed Apr 29, 2009 3:35 pm

Hi Guys

i have a script that runs every morning at 6 to disconnect to ppp active users for radius to do backed radius scripting

currently my radius takes to heavy load when the disconnects happen to quick

my one liner is

/ppp active remove [ /ppp active find]

i want to add a little sleep for 5s, in bash and perl its very simple, but i have no idea how to in MT

:delay-time 5s [/ppp active remove [ /ppp active find] ]

something in this sense

any pointers would be apreciated

Thanks

S
 
User avatar
mrz
MikroTik Support
MikroTik Support
Posts: 7056
Joined: Wed Feb 07, 2007 12:45 pm
Location: Latvia
Contact:

Re: command substitution for one liner

Wed Apr 29, 2009 3:42 pm

So you want 5s delay before script starts to remove active users
or you want 5s delay after each removed active user?
 
sewlist
Frequent Visitor
Frequent Visitor
Topic Author
Posts: 70
Joined: Fri Jun 02, 2006 3:48 pm

Re: command substitution for one liner

Wed Apr 29, 2009 4:00 pm

after each removed users

i reckon ill have to use a for loop?

/ppp active remove [:delay 5s /ppp active find] ]

Thanks

S
 
User avatar
mrz
MikroTik Support
MikroTik Support
Posts: 7056
Joined: Wed Feb 07, 2007 12:45 pm
Location: Latvia
Contact:

Re: command substitution for one liner

Wed Apr 29, 2009 4:07 pm

:foreach i in=[ppp active find] do={
/ppp active remove $i;
:delay 5s;
}
 
sewlist
Frequent Visitor
Frequent Visitor
Topic Author
Posts: 70
Joined: Fri Jun 02, 2006 3:48 pm

Re: command substitution for one liner

Wed Apr 29, 2009 4:42 pm

your a champion

works perfect

S

Who is online

Users browsing this forum: No registered users and 68 guests