Created
August 8, 2013 08:28
-
-
Save johanmeiring/6182729 to your computer and use it in GitHub Desktop.
Ping a subnet and record reachable IPs in a file.
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/bash | |
COUNTER=1 | |
rm ips | |
while [[ $COUNTER -lt 255 ]]; do | |
ping 192.168.254.$COUNTER -c 1 -W 1 && echo "192.168.254.$COUNTER" >> ips | |
COUNTER=$(( $COUNTER + 1 )) | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment