tricky iptables question (running external script)
I have an internet connection that i am sharing with my room mates for some monthly fee. I have a list of my customers "IP:Timestamp" where in timestamp is the date (%s) they paid the monthly fee. Now what I want to do is tell the iptables to read this file and compare the timestamp of each user's IP with the current timestamp and if there's already 30 days difference, it will block all that user's traffic except web, and transparently redirect him into a custom webpage saying he needs to pay again for the internet connection. once he pays again, i will just update his timestamp and he should be able to surf the internet again.
Any idea how to accomplish this? I'm thinking of writing a script which will be run by cron every, say 5 minutes and it will read the file then update the iptables rules correspondingly. You might have a better idea.