The below code is written in a python file.
When I run this via Shell it eliminates duplicate IP TABLE entries.
But when I run this via a cron job scheduled for every 30 seconds, it doesn't work.
stream = os.popen("iptables-save | awk ' !x[$0]++' | iptables-restore")