.:Hledání:.



ping celeho rozsahu podsite napr 192.168.1.X


Hlasování: 3 (188)   +-


hlavni script:

<ping_more.sh>


#/bin/sh

mask=$1
f=$2
t=$3

if [ "$mask" == "" ]
then
mask="192.168.1"
fi

if [ "$f" == "" ]
then
f=1
fi

if [ "$t" == "" ]
then
t=254
fi

until [ "$f" -eq "$t" ]; do

bash /home/sinker/scripts/ping_ip.sh $mask.$f &

f=$((f + 1))
done


until [ `ps | grep ping | wc -l` -eq "0" ]; do

sleep 0.1

done

echo "--------------------"
echo "complete $mask.0"


ping jedne IP adresy:

<ping_ip.sh>


#/bin/sh

ip=$1

if [ "$ip" == "" ]
then
echo error
exit
fi

ping $ip -c 1 > /dev/null

if [ $? -eq 0 ]
then
echo "$ip - OK"
fi