Community discussions

MikroTik App
 
Ehman
Member
Member
Topic Author
Posts: 391
Joined: Mon Nov 15, 2010 10:49 pm

remove namefilter address-list

Mon Jun 16, 2014 1:19 am

Hi

Can someone help me with this one

I need a script that removes all the address-list entry's that starts with "T-"

I've tried everything, I cant figure it out

Here is my script that removes everything in my address-list
:foreach counter in=[/ip firewall address-list find ] do={/ip firewall address-list remove $counter}
 
User avatar
c0d3rSh3ll
Long time Member
Long time Member
Posts: 557
Joined: Mon Jul 25, 2011 9:42 pm
Location: [admin@Chile] >

Re: remove namefilter address-list

Mon Jun 16, 2014 7:08 am

I need a script that removes all the address-list entry's that starts with "T-"

ros code

/ip firewal address-list remove [find list~"T-"]
Here is my script that removes everything in my address-list
for remove everything in your address list the best way is

ros code

/ip firewal address-list remove [find]
 
Ehman
Member
Member
Topic Author
Posts: 391
Joined: Mon Nov 15, 2010 10:49 pm

Re: remove namefilter address-list

Mon Jun 16, 2014 1:40 pm

thx :)
 
User avatar
rextended
Forum Guru
Forum Guru
Posts: 12438
Joined: Tue Feb 25, 2014 12:49 pm
Location: Italy
Contact:

Re: remove namefilter address-list

Mon Jun 16, 2014 2:42 pm

>>>I need a script that removes all the address-list entry's that starts with "T-"
starts?

this is wrong, this is containing "T-":

ros code

/ip firewal address-list remove [find list~"T-"]
use this:
/ip firewal address-list remove [find where list~"^T-"]
 
Ehman
Member
Member
Topic Author
Posts: 391
Joined: Mon Nov 15, 2010 10:49 pm

Re: remove namefilter address-list

Mon Jun 16, 2014 2:53 pm

Thx

Who is online

Users browsing this forum: edupre and 22 guests