Created
February 27, 2011 07:53
-
-
Save eiiches/845995 to your computer and use it in GitHub Desktop.
Search hosts available for SSH.
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 | |
grep 'ant\|bee\|cat\|dog\|emu' /etc/hosts | while read ip host; do | |
nc -w 1 -z "$ip" 22 > /dev/null && echo "$host" & | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment