Community discussions

MikroTik App
 
User avatar
greek
Member Candidate
Member Candidate
Topic Author
Posts: 118
Joined: Thu Nov 04, 2010 11:37 pm
Location: Russia, 78rus

How to change one parametr for many items?

Thu Oct 30, 2014 1:46 pm

Hello.

How to make this command more shortly?

/ip hotspot profile set 1,2,3,4,5,6,7,8,9,0,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33 http-cookie-lifetime=1h

May be

ros code

/ip hotspot profile set number=1-33  http-cookie-lifetime=1h
or

ros code

/ip hotspot profile set number={1..15,16..33}  http-cookie-lifetime=1h
but it does not work.

ps:
:for n from=1 to=33 do={/ip hotspot profile set number=$n http-cookie-lifetime=1h}

is workaround, but it's long too.
 
User avatar
janisk
MikroTik Support
MikroTik Support
Posts: 6263
Joined: Tue Feb 14, 2006 9:46 am
Location: Riga, Latvia

Re: How to change one parametr for many items?

Thu Oct 30, 2014 2:52 pm

well. there are not a log of options for you to consider. One is the script like you wrote - a for loop. other is to use some identification, like common parameter, like comment and then you can filter that way

ros code

/ip hotspot profile set http-cookie-lifetime=1h [find where comment="usual-suspect"]
 
User avatar
greek
Member Candidate
Member Candidate
Topic Author
Posts: 118
Joined: Thu Nov 04, 2010 11:37 pm
Location: Russia, 78rus

Re: How to change one parametr for many items?

Thu Oct 30, 2014 3:04 pm

Thank you for answer!

I have more than 40 almost identical profiles with minimal diferences and i need to change range

numbers=1-5,7,9,20-37

Can i do it easy ? (Without numbers=1,2,3,4,5,7,9,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37)
 
User avatar
janisk
MikroTik Support
MikroTik Support
Posts: 6263
Joined: Tue Feb 14, 2006 9:46 am
Location: Riga, Latvia

Re: How to change one parametr for many items?

Thu Oct 30, 2014 3:06 pm

add some comment and then you will be able to find them using that. Or add comment for the rest and look for entries that does not match your string entry.

you have to manage that when you are creating them.

Who is online

Users browsing this forum: miker3000, ringrring and 129 guests