view setup.sh @ 2:a5fc9c16087c

Add setup script to symlink files
author IBBoard <dev@ibboard.co.uk>
date Sat, 27 Jul 2013 19:57:26 +0100
parents
children 2a6d32a03c0e
line wrap: on
line source

#! /bin/bash

SCRIPTPATH=`dirname $(readlink -f $0)`
create_symlink() {
	if [ ! -e $2 ]; then
		ln -s $SCRIPTPATH/$1 $2
	elif [ "$(readlink $2)" != "$SCRIPTPATH/$1" ]; then
		echo "Unable to link $1 config - $2 already existed" >&2
	fi
	#Else it already existed but was correct
}

create_symlink tmux.conf ~/.tmux.conf
create_symlink hgrc ~/.hgrc
create_symlink bashrc ~/.bashrc