Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- # Set Variables
- verbose=true
- hostsfile="./inventory/hosts"
- # List hosts we're going to try to connect to, skipping blank lines and # comments
- hosts=( `grep -vE '^(\s*$|#)' $hostsfile`)
- # Do something to each host
- for host in "${hosts[@]}"; do
- echo "Connecting to $host"
- ssh root@$host uname -a
- done
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement