There are a lot of rules in “ip firewall filter”. Some of them are commented. Comments starts “MYRULE_” (for example MYRULE_user1, MYRULE_user2, and so on …)
I need to delete all ip firewall flter rules, where comment started with string “MYRULE_” .
I know how to do that in command line:
ip firewall filter remove [find [:pick $comment 0 6]="MYRULE"]
Now the same thing I need to do in PHP API. How to do it?
Acually I solved that, but I don’t like the solution so much …
My sollution:
Read all rules from ip/firewall/filter to PHP array.
Filter the array.
Remove from ip/firewall/filter .id’s from the filtered array.
It works, but there are 3 steps. Better would be 1 step - just “Remove from ip/firewall/filter all rules, where comment contain MYRULES.” But I don’t know, how to do that.