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 LalReceived 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