i wrote a simple shell script which ping the provided range of ip in a Lan network and shows the host is up or down.
ping.sh
Now lets run it
./ping.sh 100 120
Thanks..
ping.sh
#!/bin/bash
# ./ping.sh <starting_address> <end_address>
# ./ping.sh 100 120
#
for((x=$1;x<=$2;x++))
do
ping -W1 -c1 192.168.0.$x > /dev/null
if [ $? -eq 0 ]
then
echo "host 192.168.0.$x : Up"
else
echo "host 192.168.0.$x : Down"
fi
done
Now lets run it
./ping.sh 100 120
Thanks..