Last active
August 29, 2020 15:36
-
-
Save jskrivseth/db7bd7d2e313d8253e8d50daa08ca5b0 to your computer and use it in GitHub Desktop.
Run yum update on all named hosts
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 | |
hosts=( "host1" "host2" ) | |
for i in "${hosts[@]}" | |
do | |
echo "----------" | |
echo "- Host: $i" | |
ssh -q "$i" << SSH_COMMANDS | |
sudo yum update -y | |
exit | |
SSH_COMMANDS | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment