Shared publicly  - 
 
Finally got around to scripting syncing my .bash_aliases (and other stuff) across servers. Is there a better way to do this?

#!/bin/bash
SERVERS=(server1.com server2.com server3.etc)
SERVERCOUNT=${ #SERVERS[@]};
for((i=0;i<$SERVERCOUNT;i++));do
scp ~/server_bash_aliases ${SERVERS[${i}]}:.bash_aliases
ssh -t ${SERVERS[${i}]} 'sudo cp ~/.bash_aliases /root'
done

Also, is there better way to post code on g+?
1
Patrick Tuckey's profile photo
 
But how do you get that script? CHICKEN EGG!
Add a comment...