/ 雑記帳

pingで一個ずつ叩く...

#!/bin/sh

echo "-現PC IP------"

mip=`ip a | grep inet | grep -v 127 | grep -v inet6 | grep eth | ¥

awk '{print $2}' | awk -F"/" '{print $1}'`

mip2=`ip a | grep inet | grep -v 127 | grep -v inet6 | grep eth | awk '{print $2}' |¥

awk -F"/" '{print $1}'| sed 's/[1-9]$/¥,/g' | sed 's/¥.¥,//g'`

echo "$mip"

#echo "$mip2"

for i in `seq 1 1 64`

do

# echo "$i"

res=`ping -c 1 "$mip2.$i" | grep ttl | awk '{print $8}'`

pcn=`echo "192.168.11.$i"`

if [ "$res" = "ms" ]

then

echo "-------------"

echo "Respons OK"

echo "$pcn"

#else

#echo "-------------"

#echo "192.168.11.$i"

#echo "レスポンスがありません"

fi

done


— posted by くま at 02:58 pm   pingTrackBack [0]

この記事に対するコメントはありません

<< 2015.11 >>
SMTWTFS
1234567
891011121314
151617 181920 21
2223 242526 27 28
29 30      
 
























T: Y: ALL: Online:
ThemePanel
Created in 0.0674 sec.