[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Calling external file parameters into scripts?



On Mon, Aug 06, 2001 at 08:55:06PM -0500, Lance Peterson wrote:
> I'm trying to call an external file in a bash firewall script on my Debian
> system.  The external file is /etc/ban_list.  I tried this without success:
> 
> for site in /etc/ban_list; do
>    iptables -A banned_site -s site -j DROP
> done
> 
> Can someone show me the right way to call in parameters to a script from
> an external file?

Umm, is "banned_site" a parameter to iptables or a variable?

for site in $(cat /etc/ban_list); do
   iptables -A banned_site -s $site -j DROP
done

-- 
Eric G. Miller <egm2@jps.net>



Reply to: