Community discussions

MikroTik App
netgroup
刚刚加入了
Topic Author
Posts: 2
加入: Sun Nov 06, 2011 8:48 pm

I need a script - please help

Thu Nov 10, 2011 11:21 am

Hi all,
I need your help to solve the following problem:
i have the following situation:
-a) in ip / firewall / address-list I have a few address
-b) in /file have a fileaddress-list.rscwith lines of the form
/ ip firewall address-list
add address = 89.x.x.171 disabled = no list = test
add address = 89.x.x.104 disabled = no list = test
add address = 89.x.x.126 disabled = no list = test
add address = 89.x.x.156 disabled = no list = test
...
....
I need a script to empty the contents of -a) , then execute the file address-list.rsc
Thank you very much!

列维
Top
用户头像
sadeghrafie
Long time Member
Long time Member
Posts: 514
加入: Sat Nov 14, 2009 11:28 am
Location:Bushehr, IRAN

Re: I need a script - please help

Thu Nov 10, 2011 11:57 am

Code:Select all
{ :local i; :foreach i in=[/ip firewall address-list find] do={[/ip firewall address-list remove numbers=$i;]} : import address-list.rsc ; }
Top
netgroup
刚刚加入了
Topic Author
Posts: 2
加入: Sun Nov 06, 2011 8:48 pm

Re: I need a script - please help

Thu Nov 10, 2011 12:35 pm

works very well !!!

Thank you very much!sadeghrafie

列维
Top
用户头像
sadeghrafie
Long time Member
Long time Member
Posts: 514
加入: Sat Nov 14, 2009 11:28 am
Location:Bushehr, IRAN

Re: I need a script - please help

Fri Nov 11, 2011 11:00 am

:Dkarma:D
Top
psamsig
Member Candidate
Member Candidate
Posts: 161
加入: Sun Dec 06, 2009 1:36 pm
Location:Denmark

Re: I need a script - please help

Fri Nov 11, 2011 10:50 pm

Code:Select all
/ip firewall address-list remove [find]
is all it takes to clear address-list
Top
用户头像
sadeghrafie
Long time Member
Long time Member
Posts: 514
加入: Sat Nov 14, 2009 11:28 am
Location:Bushehr, IRAN

Re: I need a script - please help

Sat Nov 12, 2011 6:56 am

Code:Select all
/ip firewall address-list remove [find]
is all it takes to clear address-list
Thanks. There is always a new way. cause I was interested of programming, mine goes too long:wink:
Top

Who is online

Users browsing this forum:fposavecand 11 guests