Re: Prosze o opinie o exatel-u

Autor: Piotr KUCHARSKI <chopin_at_sgh.waw.pl>
Data: Tue 22 May 2007 - 19:48:50 MET DST
Message-ID: <bT441uqvIpqeN34.chopin@akson.sgh.waw.pl>
Content-Type: text/plain; charset=ISO-8859-2

Lukasz Trabinski <lukasz@trabinski.nospam.net> wrote:
> for a in `peval as5617`;
> do iptables -A FORWARD -s 0/0 -d `echo $a|
> sed s/","/""/g|sed s/"{"/""/g|sed s/"}"/""/g|sed s/")"/""/g|
> sed s/"("/""/g` -j ACCEPT ;done
> pewnie tego seda też dałoby się jakoś skrócić...

O rany, ale brzydki skrypt.

peval as5617 | tr -d '[,{}()]' | fmt -1 | \
xargs -I{} iptables -A FORWARD -s 0/0 -d {} -j ACCEPT

Albo choć

for i in `peval as5617 | tr -d '[,{}()]'`; do
  iptables -A FORWARD -s 0/0 -d $i -j ACCEPT
done

p.

PS peval daje duplikaty, np.: 217.96.0.0/14, 217.96.0.0/16,
   217.97.0.0/16, 217.98.0.0/16, 217.99.0.0/16

-- 
Beware of he who would deny you access to information, for in his
heart he dreams himself your master.   -- Commissioner Pravin Lal
Received on Tue May 22 19:50:07 2007

To archiwum zostało wygenerowane przez hypermail 2.1.8 : Tue 22 May 2007 - 20:40:01 MET DST