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