Skip to content

Instantly share code, notes, and snippets.

@RVIRUS0817
Last active November 16, 2016 03:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save RVIRUS0817/4241a32fdaad7246ed5b1b43ebc56f03 to your computer and use it in GitHub Desktop.
Save RVIRUS0817/4241a32fdaad7246ed5b1b43ebc56f03 to your computer and use it in GitHub Desktop.
shell script
# /bin/sh
SERVERDIR=/home/adachin/work/server/http-conf
REPODIR=/home/adachin/work/server/httpd-conf
HTTPDIR=/etc/httpd/conf/local
#各サーバに飛ばす
for x in `seq 1 20`; do
echo "server$x"
scp $REPODIR/httpd.conf adachin@server$x:$SERVERDIR
ssh -t adachin@server$x sudo cp -r $SERVERDIR/httpd.conf $HTTPDIR
done
#apacheのconfを各サーバに送り自動化。ansibleやるまでもないからシェルスクリプトで。
→結局ansibleの方がいいね
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment