Here is my script that I use to update iptables with data. The different files are listed in lists and are hopefully somewhat self explanatory