-
-
Save ImadABID/ccb1449316128b40f45adab3b98c3dc0 to your computer and use it in GitHub Desktop.
Shell script to scan a range of IP addresses.USAGE:./pingscan 192.168.1.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
: ${1?"Usage: $0 ip subnet to scan. eg '192.168.1.'"} | |
subnet=$1 | |
for addr in `seq 0 1 255 `; do | |
# ( echo $subnet$addr) | |
( ping -c 3 -t 5 $subnet$addr > /dev/null && echo $subnet$addr is Alive ) & | |
done | |
wait | |
echo 'scan done' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment