#!/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 TrackBack [0]
Comments