<span class="gmail_quote">2008/6/7, Cameron Hutchison <<a href="mailto:lists@xdna.net">lists@xdna.net</a>>:</span><blockquote class="gmail_quote" style="margin:0;margin-left:0.8ex;border-left:1px #ccc solid;padding-left:1ex">
Bart Silverstrim <<a href="mailto:bsilver@chrononomicon.com">bsilver@chrononomicon.com</a>> writes:<br> <br> >So to be clear, the script I'm now using is...<br> >**********<br> >#!/bin/bash<br> <br> >join -v2 \<br>
 >   <(iptables -L INPUT -n | grep DROP | awk '{print $4}' | sort -u) \<br> >   <(grep -i slurp /var/log/apache-perl/access.log |awk '{print $1}' |<br> >sort -u) | \<br> >egrep '^([[:digit:]]+[.]){3}[[:digit:]]+$' |\<br>
 >while read ip; do<br> >   iptables -A INPUT -s $ip -j DROP<br> >done<br> >***********<br> <br> <br>One more refinement I can see - grep piped into awk is redundant most of<br> the time.<br> <br> The command pipeline:<br>
 <br>  grep DROP | awk '{print $4}'<br> <br>can be replaced with<br>  awk '/DROP/ {print $4}'<br> <br> The second one:<br>  grep -i slurp .../access.log | awk '{print $1}'<br> is a little trickier since awk does not have a non-verbose<br>
 case-insensitive switch, so you have to do one of these:<br>  awk '/[Ss][Ll][Uu][Rr][Pp]/ {print $1}' .../access.log<br>  awk '/slurp/ {print $1}' IGNORECASE=1 .../access.log<br> <br> </blockquote><p>This thread seems to be a follow up to another thread. Which one? I would like to know what this script does (I'm a beginner so I can't really figure it out myself).<br>
</p><p></p><p>Thanks</p><p>J.R.</p>