Articles
Articles
Ping-a-net script
01-21-09
This is a simple, but useful script (in a couple of flavors) I have used to find out what is responding to ping on my network:
bourne shell:
for (( ip=1 ; ip<=254 ; ip++ )); do ping -c 1 -t 1 192.168.1.$ip > /dev/null; [ $? -eq 0 ] && echo “192.168.1.$ip UP” || : ; done
using perl:
for ip in $(perl -e '$,="\n"; print 1 .. 255;'); do ping -c 1 192.168.1.$ip > /dev/null; [ $? -eq 0 ] && echo “192.168.1.$ip UP” || : ; done
Copyright © 2010 Texas Sun Users Group.
