#!/bin/sh
# white list of IP addresses those are allowed to access MySQL on port 3306
`iptables -F INPUT`
while read server; do
`iptables -A INPUT -p tcp --dport 3306 -s $server -j ACCEPT`
done <<HERE
x.x.x.x
HERE
`iptables -A INPUT -p tcp --dport 3306 -j REJECT`
`service iptables save`
exit 0;