From 39b54a54c388e71ad3dcb2c72eefcad00073ac53 Mon Sep 17 00:00:00 2001 From: "luk.lu" Date: Fri, 17 Jun 2022 12:32:53 +0800 Subject: [PATCH] u --- debian-add-user.sh | 8 ++++++-- debian-config.sh | 1 - debian-install.sh => debian-ddinstall.sh | 0 docker-install.sh | 2 +- home-config.sh | 3 ++- 5 files changed, 9 insertions(+), 5 deletions(-) rename debian-install.sh => debian-ddinstall.sh (100%) mode change 100755 => 100644 diff --git a/debian-add-user.sh b/debian-add-user.sh index 1a90f6c..8d43257 100755 --- a/debian-add-user.sh +++ b/debian-add-user.sh @@ -34,6 +34,10 @@ chmod a-w /etc/sudoers.d/${NewUser//./-} echo # 注意,在这里为新用户创建的配置文件,主人是 root,而不是新用户 -echo "<<< Configure $NewUser home" +echo "<<< Configure $NewUser home with standard scripts? (注意,由 root 为新用户创建的配置文件的 owner 是 root,而不是新用户)" +read -p "y for yes, anything else for no >> " YesOrNo +if [ $YesOrNo = 'y' ] +then source /faronear/fon/sysconfig/home-config.sh /faronear/fon/sysconfig/nixhome /home/$NewUser -echo +fi + diff --git a/debian-config.sh b/debian-config.sh index 5a36624..10870d3 100755 --- a/debian-config.sh +++ b/debian-config.sh @@ -56,7 +56,6 @@ echo "<<< Add a new user $NewUser" source /faronear/fon/sysconfig/debian-add-user.sh $NewUser echo - echo "<<< Disallow root login: #PermitRootLogin yes" # emacs /etc/ssh/sshd_config sed -i "s|^PermitRootLogin yes|#PermitRootLogin yes|g" /etc/ssh/sshd_config diff --git a/debian-install.sh b/debian-ddinstall.sh old mode 100755 new mode 100644 similarity index 100% rename from debian-install.sh rename to debian-ddinstall.sh diff --git a/docker-install.sh b/docker-install.sh index 8e50bcb..a906424 100755 --- a/docker-install.sh +++ b/docker-install.sh @@ -35,7 +35,7 @@ echo Install Docker-Compose ... sudo curl -L $COMPOSE_URL/docker-compose-`uname -s`-`uname -m` > /usr/local/bin/docker-compose sudo chmod +x /usr/local/bin/docker-compose -read -p "配置中国加速镜像源 /etc/docker/daemon.json (d: Docker中国, t: 腾讯云, z: 中科大) >> " DOCKER_MIRROR +read -p "配置中国加速镜像源 /etc/docker/daemon.json (d: Docker中国, t: 腾讯云, z: 中科大, leave blank for no mirror) >> " DOCKER_MIRROR if [ $DOCKER_MIRROR = 'd' ] then DOCKER_MIRROR=https://registry.docker-cn.com diff --git a/home-config.sh b/home-config.sh index 79c68fe..d7283ef 100755 --- a/home-config.sh +++ b/home-config.sh @@ -4,6 +4,7 @@ if [ $1 ] then SourcePath=$1 else + echo "Configure private home settings" echo "Usage: setup.sh [Config-Source-Path] [User-Home-Path]" read -p "Enter config source path (leave blank for [/Users/luk.lu]/faronear/fon/sysconfig/nixhome) >> " SourcePath if [ ! $SourcePath ] @@ -39,7 +40,7 @@ then do rm -fr $homescript.backup mv $homescript $homescript.backup - ln -s $SourcePath/$homescript $HomePath + cp -r $SourcePath/$homescript $HomePath done popd else