Add setup script to symlink files
author |
IBBoard <dev@ibboard.co.uk> |
date |
Sat, 27 Jul 2013 19:57:26 +0100 |
parents |
|
children |
2a6d32a03c0e |
rev |
line source |
2
|
1 #! /bin/bash
|
|
2
|
|
3 SCRIPTPATH=`dirname $(readlink -f $0)`
|
|
4 create_symlink() {
|
|
5 if [ ! -e $2 ]; then
|
|
6 ln -s $SCRIPTPATH/$1 $2
|
|
7 elif [ "$(readlink $2)" != "$SCRIPTPATH/$1" ]; then
|
|
8 echo "Unable to link $1 config - $2 already existed" >&2
|
|
9 fi
|
|
10 #Else it already existed but was correct
|
|
11 }
|
|
12
|
|
13 create_symlink tmux.conf ~/.tmux.conf
|
|
14 create_symlink hgrc ~/.hgrc
|
|
15 create_symlink bashrc ~/.bashrc |