[96375] in RedHat Linux List

home help back first fref pref prev next nref lref last post

Re: PING Program

daemon@ATHENA.MIT.EDU (Linux User)
Mon Oct 26 18:02:41 1998

Date: Mon, 26 Oct 1998 18:01:51 -0500 (EST)
From: Linux User <linuxuser@linuxtest.fellows.denison.edu>
To: redhat-list@redhat.com
In-Reply-To: <199810231631.LAA31840@isunix.it.ilstu.edu>
Resent-From: redhat-list@redhat.com
Reply-To: redhat-list@redhat.com


Tim:
Why do you do the scan in parts 1-50, 51- etc. 
(others: see script below)

thanks, 

Fahd Sultan
Software Techie
Denison U.
linuxuser@linuxtest.fellows.denison.edu
sultan_f@denison.edu

On Fri, 23 Oct 1998, Tim Hockin wrote:

> 
> eek, that ping script I sent was rather old.  everyone who loked at it.  it
> can be made significantly more efficient .  here is the revision:
> 
> 
> Tim
> 
> #!/bin/sh
> # pingit
> # by Tim Hockin <thockin@ais.net>
> # 1997
> 
> # time to wait for a response
> SLEEP=1
> 
> #ping a whole class C - easily modified for a smaller range
> if [ foo$1 = foo ]; then
> 	echo "USAGE: $0 -  <ipnetwork>"
> 	echo "   eg: $0 192.168.1 "
> 	exit
> else
> 	IP=$1
> fi
> 
> I=1	
> S=55
> 
> while [ $I -lt 255 ]; do
>    while [ $I -lt $S ]; do
> 	(ping -c1 $IP.$I > /dev/null 2>&1 && echo $IP.$I    is up &)
> 	I=$((I+1))
>    done
> 
>    # give memory a break...
>    sleep $SLEEP 
> 
>    # if it hasn't answered by now, it is probably not alive..
>    killall ping > /dev/null 2>&1
> 
>    # increment our upper bound
>    S=$((S+50))
> done
> 
> 
> -- 
>   PLEASE read the Red Hat FAQ, Tips, Errata and the MAILING LIST ARCHIVES!
> 		http://www.redhat.com http://archive.redhat.com
>          To unsubscribe: mail redhat-list-request@redhat.com with 
>                        "unsubscribe" as the Subject.
> 


-- 
  PLEASE read the Red Hat FAQ, Tips, Errata and the MAILING LIST ARCHIVES!
		http://www.redhat.com http://archive.redhat.com
         To unsubscribe: mail redhat-list-request@redhat.com with 
                       "unsubscribe" as the Subject.


home help back first fref pref prev next nref lref last post