This commit is contained in:
Luk Lu
2022-06-18 11:24:15 +08:00
parent 037bc6ed34
commit e66d38999b
2 changed files with 12 additions and 6 deletions

View File

@@ -6,7 +6,9 @@ then
else
echo "Configure private home settings"
echo "Usage: setup.sh [Config-Source-Path] [User-Home-Path] [--AdotMode]"
read -p ">> Enter config source path (leave blank for [/Users/luk.lu]/faronear/fon/sysconfig/nixhome) >> " SourcePath
echo
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"
@@ -35,7 +37,9 @@ if [ -d $SourcePath ] && [ -d $HomePath ]
then
pushd $HomePath
homescriptlist=".emacs .emacs.lisp .bashrc .bash_profile .gitignore"
read -p ">> Copy or link scripts? l for link, anything else for copy >> " CopyOrLinkScripts
echo
echo ">> Copy or link scripts? l for link, anything else for copy:"
read -p ">> " CopyOrLinkScripts
for homescript in $homescriptlist
do
rm -fr $homescript.backup
@@ -49,7 +53,9 @@ then
cp -r $SourcePath/$homescript $HomePath
fi
done
read -p ">> Append or link or omit [.ssh/authorized_keys]? a for append, l for link, anything else for omit >> " CopyOrLinkOrOmitAuthorizedKeys
echo
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 ..."