Skip to content

Instantly share code, notes, and snippets.

@HarshitRuwali
Created June 4, 2022 17:23
Show Gist options
  • Save HarshitRuwali/a838c218233c1ed65e6bf2d6f817a16f to your computer and use it in GitHub Desktop.
Save HarshitRuwali/a838c218233c1ed65e6bf2d6f817a16f to your computer and use it in GitHub Desktop.
update multiple servers without any effort
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