u
This commit is contained in:
parent
e66d38999b
commit
1034cfa0fa
@ -7,11 +7,12 @@ else
|
||||
echo "Configure private home settings"
|
||||
echo "Usage: setup.sh [Config-Source-Path] [User-Home-Path] [--AdotMode]"
|
||||
echo
|
||||
echo ">> Enter config source path (leave blank for [/Users/luk.lu]/faronear/fon/sysconfig/nixhome):"
|
||||
echo "=== Enter config source path (leave blank for [/Users/luk.lu]/faronear/fon/sysconfig/nixhome):"
|
||||
read -p ">> " SourcePath
|
||||
if [ ! $SourcePath ]
|
||||
then
|
||||
echo "Use default source path: [Users/luk.lu]/faronear/fon/sysconfig/nixhome"
|
||||
echo
|
||||
if [ -d /faronear/fon/sysconfig/nixhome ]
|
||||
then
|
||||
SourcePath=/faronear/fon/sysconfig/nixhome
|
||||
@ -38,7 +39,7 @@ then
|
||||
pushd $HomePath
|
||||
homescriptlist=".emacs .emacs.lisp .bashrc .bash_profile .gitignore"
|
||||
echo
|
||||
echo ">> Copy or link scripts? l for link, anything else for copy:"
|
||||
echo "=== Copy or link scripts? l for link, anything else for copy:"
|
||||
read -p ">> " CopyOrLinkScripts
|
||||
for homescript in $homescriptlist
|
||||
do
|
||||
@ -54,18 +55,15 @@ then
|
||||
fi
|
||||
done
|
||||
echo
|
||||
echo ">> Append or link or omit [.ssh/authorized_keys]? a for append, l for link, anything else for omit:"
|
||||
echo "=== Append or link or omit [.ssh/authorized_keys]? a for append, l for link, anything else for omit:"
|
||||
read -p ">> " CopyOrLinkOrOmitAuthorizedKeys
|
||||
if [ $CopyOrLinkOrOmitAuthorizedKeys = 'l' ]
|
||||
then
|
||||
echo "--- Linking $SourcePath/authorized_keys to $HomePath/.ssh/authorized_keys ..."
|
||||
mkdir -p $HomePath/.ssh
|
||||
chmod 700 $HomePath/.ssh
|
||||
if [ -e $HomePath/.ssh/authorized_keys ]
|
||||
then
|
||||
rm -fr $HomePath/.ssh/authorized_keys.backup
|
||||
mv $HomePath/.ssh/authorized_keys $HomePath/.ssh/authorized_keys.backup
|
||||
fi
|
||||
ln -s $SourcePath/.ssh/authorized_keys $HomePath/.ssh/authorized_keys
|
||||
elif [ $CopyOrLinkOrOmitAuthorizedKeys = 'a']
|
||||
then
|
||||
@ -79,5 +77,5 @@ else
|
||||
echo "!!! Not existing $SourcePath or $HomePath, please try again."
|
||||
fi
|
||||
|
||||
echo "--- Sourcing $HomePath/.bashrc ..."
|
||||
echo "=== Sourcing $HomePath/.bashrc ..."
|
||||
source $HomePath/.bashrc
|
||||
|
Loading…
Reference in New Issue
Block a user