-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathupdate.sh
More file actions
executable file
·63 lines (54 loc) · 1.41 KB
/
update.sh
File metadata and controls
executable file
·63 lines (54 loc) · 1.41 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
#!/bin/bash
REL="$HOME/setup"
PWD=$(pwd)
function updatelink {
sourcefile=$1
file=$2
if [ ! -e $sourcefile ];then
echo sourcefile $sourcefile does not exist
exit 0
fi
if [ -e $file ]; then
if [ -L $file ]; then
link=$(readlink -n $file)
if [ "$link" != "$sourcefile" ]; then
echo $file points to $link not $sourcefile fixing symlink
rm -ri $file
ln -s $sourcefile $file
fi
else
echo $file is not a symlink. Deleting and linking
rm -ri $file
ln -s $sourcefile $file
fi
else
echo $file does not exist. Linking
ln -s $sourcefile $file
fi
}
function makedir {
dir=$1
if [ ! -d $dir ];then
mkdir -v $dir;
fi;
}
git pull
git submodule init
git submodule update
updatelink $REL/tmux.conf $HOME/.tmux.conf
updatelink $REL/bashrc $HOME/.bashrc
updatelink $REL/bash_profile $HOME/.bash_profile
updatelink $REL/vimrc $HOME/.vimrc
#rm -ri $HOME/.vim
makedir $HOME/.vim/
makedir $HOME/.vim/bundle
updatelink $REL/vim/bundle/neobundle.vim $HOME/.vim/bundle/neobundle.vim
updatelink $REL/vim/colors $HOME/.vim/colors
updatelink $REL/gitconfig $HOME/.gitconfig
updatelink $REL/siegerc $HOME/.siegerc
updatelink $REL/csshrc $HOME/.csshrc
updatelink $REL/i2csshrc $HOME/.i2csshrc
makedir $HOME/.config
updatelink $REL/liquidpromptrc $HOME/.config/liquidpromptrc
updatelink $REL/ssh/config $HOME/.ssh/config
chmod 0600 $HOME/.ssh/config