Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- NUM_OF_SERVERS=(server1 server2)
- SSH_USERNAME=root
- SSH_PASSWORD=password
- version=$(cat /etc/redhat-release)
- for HOST in ${NUM_OF_SERVERS[@]};
- do /usr/bin/sshpass -p $SSH_PASSWORD ssh $SSH_USERNAME@$HOST echo "$version"
- echo "The software version for ${NUM_OF_SERVERS[0]} is $version"
- echo "The software version for ${NUM_OF_SERVERS[1]} is $version"
- done
- bash: -c: line 0: syntax error near unexpected token `('
- bash: -c: line 0: `echo CentOS Linux release 7.4.1708 (Core) '
- The software version for server1 is CentOS Linux release 7.4.1708 (Core)
- The software version for server2 is CentOS Linux release 7.4.1708 (Core)
- The software version for server1 is CentOS Linux release 7.4.1708 (Core)
- The software version for server2 is CentOS Linux release 7.4.1708 (Core)
Add Comment
Please, Sign In to add comment