Created
June 4, 2022 17:23
-
-
Save HarshitRuwali/a838c218233c1ed65e6bf2d6f817a16f to your computer and use it in GitHub Desktop.
update multiple servers without any effort
This file contains hidden or 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
servers=("3.**.**.**" "3.**.**.**") | |
for i in ${servers[@]}; do | |
echo -e '\e[1;32m [+] server ip \e[1;m' $i; | |
ssh -i ~/Developer/ssh-keys/aws-ssh.pem \ | |
admin@$i "cd /*r-web-customer-backend; \ | |
git pull; \ | |
pm2 restart 0 --update-env; " | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment