X-Git-Url: http://club.cc.cmu.edu/~cmccabe/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=install-symlinks.sh;h=a479ffb0b3e85a9967b348f4025d2987784c1859;hb=447c675db541a98eb4874c94cb8efad1c8b8cd68;hp=ebb21b7675de0620d44944fe6accd1948445b4ba;hpb=38d636c5132a46528ac843cae2ca09b5566e2612;p=cmccabe-etc diff --git a/install-symlinks.sh b/install-symlinks.sh index ebb21b7..a479ffb 100755 --- a/install-symlinks.sh +++ b/install-symlinks.sh @@ -15,25 +15,20 @@ die() { exit 1 } -if [ -f ../.bashrc ]; then - if [ -L ../.bashrc ]; then - : - else - echo "moving old .bashrc to .bashrc-old" - mv -f ../.bashrc ../.bashrc-old - fi -fi - copy_ssh_old=0 -if [ -d ../.ssh ]; then - if [ -L ../.ssh ]; then - : - else - echo "moving old .ssh to .ssh-old" - mv -f ../.ssh ../.ssh-old - copy_ssh_old=1 +for file in .bashrc .ssh .profile; do + if [ -f ../$file ]; then + if [ -L ../$file ]; then + : + else + echo "moving old $file to $file-old" + mv -f ../$file ../$file-old + if [ $file == .ssh ]; then + copy_ssh_old=1 + fi + fi fi -fi +done BASEDIR=`pwd` for file in ${BASEDIR}/.[^.]*; do @@ -67,5 +62,5 @@ if [ $copy_ssh_old -eq 1 ]; then echo "copying files from .ssh-old to .ssh" cp -f ../.ssh-old/* ../.ssh echo "chmod 600 ../.ssh/config" - chmod 600 ../.ssh/config + chmod 600 ../.ssh/* fi