what a pity you do not have 'ping' implemented in Linux rma
We enhanced your ping script a bit to get reply values.
It might help someone...
Regards
Ping host (advanced)
Code: Select all
#!/bin/sh
# ping -c $2 -w 4 $1 1> /dev/null 2> /dev/null
PingResult=`ping -c $2 -w 4 $1 | grep icmp_seq | awk -F= '{ print $4 }'`
if [ -z "$PingResult" ]
then
echo "ScriptRes:No answer:dead"
else
echo "ScriptRes:Host is alive:"$PingResult
fi