Code: Select all
/ip firewall address-list remove number=[find list=redirect]
This is 1st row of *.auto.rsc script. Next goes updated address-list.
/ip firewall address-list remove number=[find list=redirect]
/ip firewall address-list remove [find where list=redirect]
Thanks, i'll try. And will it work the same with:Try
Code: Select all/ip firewall address-list remove [find where list=redirect]
/ip proxy access remove number=[find action=deny]
Is there any solution?Error occurs in cases if command tries to remove an item that does not exist any more (dynamic entries that already was removed, other script or user manually is modifying address list at the same time when command is executed)
Use foreach loop which enumerate results of [find list=redirect] and for each element call remove command using exception handling (:do/on-error).Is there any solution?Error occurs in cases if command tries to remove an item that does not exist any more (dynamic entries that already was removed, other script or user manually is modifying address list at the same time when command is executed)
Прошу простить мое невежество.Use foreach loop which enumerate results of [find list=redirect] and for each element call remove command using exception handling (:do/on-error).
/ip firewall address-list
:foreach i in=[find list=redirect] do={
:do {
remove $i;
} on-error={ :put "xxx"};
}
Or should I leave it as is?Code: Select all} on-error={ :put "xxx"};
Code: Select all/ip firewall address-list :foreach i in=[find list=redirect] do={ :do { remove $i; } on-error={ :put "xxx"}; }
Thanks a lot! I'll try it.That is the message printed on error