Page 1 of 1

How to change one parametr for many items?

Posted: Thu Oct 30, 2014 1:46 pm
by greek
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.

Re: How to change one parametr for many items?

Posted: Thu Oct 30, 2014 2:52 pm
by janisk
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"]

Re: How to change one parametr for many items?

Posted: Thu Oct 30, 2014 3:04 pm
by greek
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)

Re: How to change one parametr for many items?

Posted: Thu Oct 30, 2014 3:06 pm
by janisk
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.