Advertisement
Guest User

test-connections.sh

a guest
Jul 2nd, 2014
222
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.32 KB | None | 0 0
  1. #!/bin/bash
  2.  
  3. # Set Variables
  4. verbose=true
  5. hostsfile="./inventory/hosts"
  6.  
  7. # List hosts we're going to try to connect to, skipping blank lines and # comments
  8. hosts=( `grep -vE '^(\s*$|#)' $hostsfile`)
  9.  
  10.  
  11. # Do something to each host
  12. for host in "${hosts[@]}"; do
  13.   echo "Connecting to $host"
  14.   ssh root@$host uname -a
  15. done
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement