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

View File

@ -63,7 +63,7 @@ service sshd restart
echo
echo "<<< Set hostname or leave blank for no change"
read -p "hostname = " NewHostname
read -p ">> " NewHostname
if [ $NewHostname ]
then
hostnamectl set-hostname $NewHostname
@ -73,8 +73,8 @@ else
fi
echo
echo "<<< autologin for Xfce: /etc/lightdm/lightdm.conf"
read -p "<<< Enable xfce autologin as ($NewUser for autologin or anything else for no change): " XfceAutologinUsername
echo "<<< Enable xfce autologin [/etc/lightdm/lightdm.conf] as ($NewUser for autologin or anything else for no change):"
read -p ">> " XfceAutologinUsername
if [ $XfceAutologinUsername = $NewUser ]
then
sed -i "s/^.*autologin-user=.*$/autologin-user=$NewUser/g" /etc/lightdm/lightdm.conf

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 ..."