Community discussions

MikroTik App
 
emiliano80
just joined
Topic Author
Posts: 1
Joined: Wed Sep 12, 2018 3:24 pm

Problem with script

Wed Sep 12, 2018 3:36 pm

Hi,
I need to delete a list of addresses using index number.
Using the command from the terminal works, example:
/ip firewall address-list remove numbers=6
but
but using it in a script does not work.
possible solutions?
Thanks!
 
User avatar
ADahi
Member Candidate
Member Candidate
Posts: 209
Joined: Thu Sep 21, 2017 7:16 pm
Location: Iraq, Ninavah
Contact:

Re: Problem with script

Thu Sep 13, 2018 7:47 pm

may be "no such item"
use this command to see what is the output
:put [/ip firewall address-list remove numbers=6 ]
 
nescafe2002
Forum Veteran
Forum Veteran
Posts: 897
Joined: Tue Aug 11, 2015 12:46 pm
Location: Netherlands

Re: Problem with script

Thu Sep 13, 2018 8:54 pm

Index numbers are put in buffer after print command. You cannot blindly use these numbers in script.

Use find command instead, based on properties:
/ip firewall address-list remove [ find list=<name> address=<address> ]

Who is online

Users browsing this forum: No registered users and 33 guests