I needed to check multiple addresses for use.

I did not find any ready solution so I wrote a script.

I called it psweep.sh

Here is it(comments are welcomed):

#!/bin/bash
# Sweep ping
# 1-st arg ip 2-nd start 3-d end
#
# Written by Hristo Benev
#
# rev 0.3
#
for i in `seq $2 $3`; do
ping -c 1 -W 1 $1.$i >/dev/null 2>&1
#ping -c 1 -W 1 $1.$i
if [ $? == 0 ]; then
echo “host $1.$i is up”
else
echo “.”
fi
done
# changelog
# 0.3 added progress

Share/Save/Bookmark

Comments

Leave a Reply