[SATLUG] Ping Scan A Range of Addresses

Larry Blodgett lblodgett at macosx.com
Fri Oct 1 01:07:59 CDT 2004


On Sep 30, 2004, at 3:22 PM, Ed Coates wrote:

> Larry,
>
> I don't remember if you said which Linux distro that you were using,
> but seq is located in the coreutils package for SuSE 9.1.  Install
> that, or similar, and it will work for  you.  Also remember (you've
> probably figured it out alread, but I forgot to mention it) that this
> script will only do number from 1 - 10.  You'll have to adjust the
> number for 1 254 for your subnet.
>
> Ed
>
Ed,
As you can see I am using BSD (jot)

#!/bin/bash
for ii in `jot - 1 20 1`
do
      echo "testing ${ii}"
     if ping -c 1 129.162.184.${ii} > /dev/null 2>&1
     then
         echo "129.162.184.${ii} is alive"
     fi
done

Just one last question, would you pleas explain the if statement.
It doesn't seem to be working. Every test comes back alive.
Larry



More information about the Satlug mailing list