i think something like this should work (it's just an example):
Code:
if [ -f /somewhere/goodports.txt ]
then
for i in `cat /somewhere/goodports.txt | grep -v ^# | grep -v ^$`
do
iptables -I OUTPUT -p TCP -o eth0 --dport $i -j ACCEPT
done
else
echo "No goodports.txt found..."
fi
the
goodports.txt file would look kinda like (the comments are optional):
Code:
# HTTP:
80
# HTTPS:
443
# FTP:
21
# Blah blah blah
12345
i hope this at least gives you an idea of what you need...
just my

...