u
This commit is contained in:
parent
c3680acc21
commit
91cacfecec
@ -30,11 +30,9 @@ else
|
|||||||
HomePath=~
|
HomePath=~
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ ! -d $SourcePath ]
|
if [ -d $SourcePath ] && [ -d $HomePath ]
|
||||||
then
|
then
|
||||||
echo "!!! Not existing $SourcePath, please try again"
|
echo "--- Linking $SourcePath/* to $HomePath/* ..."
|
||||||
else
|
|
||||||
echo "Linking $SourcePath/* to $HomePath/"
|
|
||||||
pushd $HomePath
|
pushd $HomePath
|
||||||
homescriptlist=".emacs .emacs.lisp .bashrc .bash_profile .gitignore"
|
homescriptlist=".emacs .emacs.lisp .bashrc .bash_profile .gitignore"
|
||||||
for homescript in $homescriptlist
|
for homescript in $homescriptlist
|
||||||
@ -44,22 +42,22 @@ else
|
|||||||
ln -s $SourcePath/$homescript $HomePath
|
ln -s $SourcePath/$homescript $HomePath
|
||||||
done
|
done
|
||||||
popd
|
popd
|
||||||
echo "Linked $SourcePath/* to $HomePath/"
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ ! -d $HomePath/.ssh ]
|
if [ ! -d $HomePath/.ssh ]
|
||||||
then
|
then
|
||||||
echo "Creating $HomePath/.ssh"
|
echo "--- Creating $HomePath/.ssh ..."
|
||||||
mkdir $HomePath/.ssh
|
mkdir $HomePath/.ssh
|
||||||
chmod 700 $HomePath/.ssh
|
chmod 700 $HomePath/.ssh
|
||||||
fi
|
fi
|
||||||
if [ -f $Homepath/.ssh/authorized_keys ]
|
if [ -e $HomePath/.ssh/authorized_keys ]
|
||||||
then
|
then
|
||||||
echo "Removing $Homepath/.ssh/authorized_keys"
|
echo "--- Removing $Homepath/.ssh/authorized_keys ..."
|
||||||
mv $Homepath/.ssh/authorized_keys $Homepath/.ssh/authorized_keys.backup
|
mv $Homepath/.ssh/authorized_keys $Homepath/.ssh/authorized_keys.backup
|
||||||
fi
|
fi
|
||||||
|
echo "--- Linking $SourcePath/authorized_keys to $HomePath/.ssh/authorized_keys ..."
|
||||||
ln -s $SourcePath/authorized_keys $HomePath/.ssh/authorized_keys
|
ln -s $SourcePath/authorized_keys $HomePath/.ssh/authorized_keys
|
||||||
echo "Linked authorized_keys"
|
else
|
||||||
|
echo "!!! Not existing $SourcePath or $HomePath, please try again."
|
||||||
|
fi
|
||||||
|
|
||||||
echo "Applying $HomePath/.bashrc"
|
echo "--- Sourcing $HomePath/.bashrc ..."
|
||||||
source $HomePath/.bashrc
|
source $HomePath/.bashrc
|
||||||
|
Loading…
Reference in New Issue
Block a user