ssalman
July 21st, 2006, 01:24 PM
Hi, I’m trying to setup a firewall blocking certain websites through a bash script using iptables based on this (https://help.ubuntu.com/community/IptablesHowTo)iptables howto.
for each blocked website I'm using the command:
iptables -A OUTPUT -d www.website.com -j DROP
Now I have many websites in a list file "block.list", and would like to have the script pass them one by one in a for loop... How would I accomplish that in a bash script?
something of the general form below:
for x in ???block.list???
do
iptables -A OUTPUT -d $x -j DROP;
done
for each blocked website I'm using the command:
iptables -A OUTPUT -d www.website.com -j DROP
Now I have many websites in a list file "block.list", and would like to have the script pass them one by one in a for loop... How would I accomplish that in a bash script?
something of the general form below:
for x in ???block.list???
do
iptables -A OUTPUT -d $x -j DROP;
done