Skip to content

Instantly share code, notes, and snippets.

@nampdn
Last active October 20, 2020 10:10
Show Gist options
  • Save nampdn/7cd9dd52b6bc62b5c0d8241bf221c55b to your computer and use it in GitHub Desktop.
Save nampdn/7cd9dd52b6bc62b5c0d8241bf221c55b to your computer and use it in GitHub Desktop.
#! /bin/bash
declare -a IPS=(10.131.79.220 10.131.78.219)
for ip in ${IPS[@]}; do
echo "Syncing to server: $ip"
rsync -avz /etc/nginx/sites-available/lb* root@${ip}:/etc/nginx/sites-available/
ssh root@${ip} sudo ln -s /etc/nginx/sites-available/lb* /etc/nginx/sites-enabled/
ssh root@${ip} sudo service nginx reload
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment