Last active
April 27, 2017 15:55
-
-
Save takakd/4cd9c806fcac53aef094169a19b39533 to your computer and use it in GitHub Desktop.
This file contains 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 | |
# for mac. | |
SEGMENT="192.168.1." | |
for i in `seq 1 255`; do | |
RET=`ping -c 1 -W 1000 ${SEGMENT}${i}` | |
echo "${RET}" | grep '100.0% packet loss' > /dev/null | |
if [ $? -eq 1 ]; then | |
echo "found,${SEGMENT}${i}" | |
else | |
echo "notfound,${SEGMENT}${i}" | |
fi | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment