I decided to carry on my hash that i was playing with and turn it into a usable script, this through a few more problems up and was wondering if i have gone about it the correct way.

I thought at one point to use two arrays one for people already banned and another for people to be banned and print the difference but couldn't find any way to compare two arrays is there a simple way to do this? I decided on deleting hash values as this was the only thing i could think of that worked.

I am not sure about the amount of times i had to open and close firewall i think there will be a better way of going about this.

sorry forgot to add would it be better to use cron to run the script every so often or put in some kind of wait and redo?

cron

If you write it as a daemon (wait & redo), then there is additional overhead. It has to periodically kill itself off and restart. It has to be able to restart if something else kills it. It has to restart on reboot. It has to assume that any opened file may not have been flushed and therefore is corrupt.