added checks for existing files
This commit is contained in:
parent
461561964a
commit
c2178640aa
22
install.sh
22
install.sh
@ -1,14 +1,20 @@
|
||||
#! /bin/bash
|
||||
set -eou pipefail
|
||||
mkdir -p $HOME/.ssh
|
||||
|
||||
|
||||
for link in bashrc gitconfig screenrc Xresources Xdefaults Xmodmap themes fonts aliases vim vimrc ;do
|
||||
|
||||
|
||||
rm -rf $HOME/.$link && ln -s $(pwd)/$link $HOME/.$link;
|
||||
|
||||
|
||||
#remove real files if present, making room for links
|
||||
if [ -f $HOME/.$link ]; then
|
||||
#echo 'removing' $HOME/.$link;
|
||||
rm $HOME/.$link;
|
||||
fi
|
||||
if [ ! -e $HOME/.$link ]; then
|
||||
#echo 'linking ' $(pwd)/$link $HOME/.$link;
|
||||
ln -s $(pwd)/$link $HOME/.$link;
|
||||
fi
|
||||
|
||||
done
|
||||
ln -s $(pwd)/sshconfig $HOME/.ssh/config
|
||||
if [ ! -e $HOME/.$link ]; then
|
||||
ln -s $(pwd)/sshconfig $HOME/.ssh/config;
|
||||
fi
|
||||
|
||||
cat $(pwd)/pubkeys/* > $HOME/.ssh/authorized_keys
|
||||
|
Loading…
Reference in New Issue
Block a user