Skip to content

Instantly share code, notes, and snippets.

@jskrivseth
Last active August 29, 2020 15:36
Show Gist options
  • Save jskrivseth/db7bd7d2e313d8253e8d50daa08ca5b0 to your computer and use it in GitHub Desktop.
Save jskrivseth/db7bd7d2e313d8253e8d50daa08ca5b0 to your computer and use it in GitHub Desktop.
Run yum update on all named hosts
#!/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