Created
August 7, 2021 03:43
-
-
Save xanoni/177f098ee5bd3abf10a98d31a62c85bd to your computer and use it in GitHub Desktop.
Copy config files to a list of servers
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
#! /usr/bin/env bash | |
servers="srv1 srv12srv3 srv4 srv5 srv6" | |
script_dir="$HOME/.configs-shared" | |
username="xyz" | |
for server in ${servers}; do | |
echo -en "\n--------------------\nServer: ${server}\n--------------------\n" | |
set -v | |
scp -r "${script_dir}"/* "${username}@${server}:/usr/local/etc/shared/" | |
set +v | |
done | |
echo -en "\n" | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment