I am trying to disable items from the address list by reading a .txt file inserted into files, but when I run the script it prompts the number of the item that I want to disable and also an error “interrupted no such item”…in other words…not working at all
Make sure this line doesn’t have the colon before “thisline”:
:local thisline;And, insert this line before the /ip firewall disable line:
/ip firewall address-list printA downside to using this method is that it generates the “numbers” based on the order the address-list entries were created, so if you delete / add / etc, the order will be different. A better way is to disable rules based on the IP or comment, which makes the script more flexible. For example, if you wanted to disable a particular IP:
/ip firewall address-list disable [find address=“192.168.1.5”]Then, regardless of the “number” of that address-list entry, it will always disable the correct one.
One other thing to keep in mind is that your txt file needs to have a new line after the last number, or it will be skipped.