-#!/bin/bash
+#!/usr/bin/env bash
#
# install-symlinks.sh
exit 1
}
+copy_ssh_old=0
+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
+done
+
BASEDIR=`pwd`
for file in ${BASEDIR}/.[^.]*; do
# get base file name, like ".gitconfig"
# skip files which we don't want to link
[ "${basefile}" == ".git" ] && continue
[ "${basefile}" == ".gitignore" ] && continue
+ #[ "${basefile}" == ".ssh" ] && continue
pushd .. > /dev/null
if [ -L ${basefile} ]; then
fi
popd > /dev/null
done
+
+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/*
+fi