6 # Script for installing symlinks to these rc files into your home directory.
7 # It's assumed that your home directory is the directory immediately above this
18 if [ -f ../.bashrc ]; then
19 if [ -L ../.bashrc ]; then
22 echo "moving old .bashrc to .bashrc-old"
23 mv -f ../.bashrc ../.bashrc-old
28 if [ -d ../.ssh ]; then
29 if [ -L ../.ssh ]; then
32 echo "moving old .ssh to .ssh-old"
33 mv -f ../.ssh ../.ssh-old
39 for file in ${BASEDIR}/.[^.]*; do
40 # get base file name, like ".gitconfig"
41 basefile=`basename ${file}`
43 # get relative file name, like "cmccabe-etc/.gitconfig"
44 relfile=`echo ${file} | sed 's_.*/\([^/]*/[^/]*\)$_\1_'`
46 # skip files which we don't want to link
47 [ "${basefile}" == ".git" ] && continue
48 [ "${basefile}" == ".gitignore" ] && continue
51 if [ -L ${basefile} ]; then
52 # Someone already created this link. Pass over it in silence
54 elif [ ! -a ${basefile} ]; then
56 ln -s ${relfile} || die "failed to link ${relfile}"
57 echo "created ${relfile}..."
58 elif [ -f ${basefile} ]; then
59 echo "${basefile} already exists as a regular file"
61 echo "${basefile} already exists"
66 if [ $copy_ssh_old -eq 1 ]; then
67 echo "copying files from .ssh-old to .ssh"
68 cp -f ../.ssh-old/* ../.ssh
69 echo "chmod 600 ../.ssh/config"