Using uci to create/get a group of firewall rules

Hey guys,

Basically I'm looking to create multiple firewall rules using the UCI command line utility however I'm not sure how to collectively create these rules and delete them..

As an example I want to create these N firewall rules

 config rule 
         #... rule details
 config rule 
         #... rule details
 config rule 
         #... rule details
#... more rules ...

however at a later time I want to delete all these create rules .

what would be the correct way to create these rules using uci in a such a way that I can identify easily identify and delete them together.

thanks

counter=0
unique_prefix="custom_rule_"

uci batch <<EOT
  set firewall.${unique_prefix}$((counter++))=rule
  set firewall.@rule[-1].name="Example #1"
  set firewall.@rule[-1].src=wan
  set firewall.@rule[-1].dest=lan
  set firewall.@rule[-1].proto=tcp
  set firewall.@rule[-1].dest_port=123
  set firewall.@rule[-1].target=ACCEPT
EOT

uci batch <<EOT
  set firewall.${unique_prefix}$((counter++))=rule
  set firewall.@rule[-1].name="Example #2"
  set firewall.@rule[-1].src=wan
  set firewall.@rule[-1].dest=lan
  set firewall.@rule[-1].proto=tcp
  set firewall.@rule[-1].dest_port=123
  set firewall.@rule[-1].target=ACCEPT
EOT

...

And to later delete your rules:

counter=0
while uci -q delete firewall.${unique_prefix}$((counter++)); do :; done