Re: [CentOS] Re: Shell script - ping

2008-07-29 Thread Hywel Richards
Can't resist posting the parallel version of this: #!/bin/bash if [ "$#" == "1" ] then ping -c2 $1 &> /dev/null if [ $? = 0 ] ; then printf "%-30s is alive \n" $1 else printf "%-30s is not alive \n" $1 fi else for n in $* do $0 $n & done wait fi This does the same thing as the

Re: [CentOS] Re: Shell script - ping

2008-07-28 Thread kapil singh
Hello, This is a running shell script for ping multiple host it provides result directly: if host is successfully ping then it returns Host is alive. otherwise Host is not alive Try this i am working with that in my local n/w. #/bin/bash for n in {1..5}; do host=192.168.1.$n ping -c2 $host &> /de

[CentOS] Re: Shell script - ping

2008-07-28 Thread Mike
I really like 'fping' for use in shell scripts. See: http://www.fping.com/ and http://fping.sourceforge.net/man/ It can be 'yum installed' from the CentOS RPMforge repo. So in your script you can just do fping -c 10 ... I don't understand exactly what 'scripts which launches 10 pings' and