for i in $(cat servers.txt); do if ssh -o ConnectTimeout=10 $i; then echo "$i is the one that works" fi done
My suggestion is to have servers.txt file actually be the host entries in ~/.ssh/config :
my_vps
my_other_vps
my_vps2
Otherwise, just type out:
user@example.com
user1@internet.com
user@internet.com
etc...
No comments:
Post a Comment