Untitled

 avatar
unknown
plain_text
2 years ago
299 B
7
Indexable
#!/bin/bash
arg="$1"
counter="$2"
while [ $counter -le $3 ]
do
        resp=$(ping -c 1 -w 2 $1.$counter) > /dev/null
        ((counter++))
if [ "$(echo $resp | grep "64 bytes"| cut -d " " -f 4 | tr -d ":" )" ];
then
echo "$resp" | grep 'PING' | awk -F "(" '{print $1, $3}' | sed 's/PING//'
fi

done
Editor is loading...