Created
August 29, 2020 15:35
-
-
Save jskrivseth/86921918c41097eac5d13a1926c59c5c to your computer and use it in GitHub Desktop.
Run apt update on all 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=( "host3" "host4" ) | |
for i in "${hosts[@]}" | |
do | |
echo "----------" | |
echo "- Host: $i" | |
ssh -q "$i" << SSH_COMMANDS | |
sudo apt-get upgrade -y | |
exit | |
SSH_COMMANDS | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment