Skip to content

Commit

Permalink
优化了 软件用户创建逻辑
Browse files Browse the repository at this point in the history
- 将 用户创建逻辑 由 install 转移到了 init
  • Loading branch information
ztj1993 committed Nov 6, 2018
1 parent 3596670 commit e1f29e6
Show file tree
Hide file tree
Showing 5 changed files with 4 additions and 18 deletions.
2 changes: 0 additions & 2 deletions Plugin/frp/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,3 @@ UnPackage_tar
### 验证软件安装
CheckInstalld_file frps
CheckInstalld_file frpc
### 配置软件
ConfigSoftware_install
2 changes: 0 additions & 2 deletions Plugin/gogs/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,3 @@ DowmPackage_wget
UnPackage_tar
### 验证软件安装
CheckInstalld_file gogs
### 配置软件
ConfigSoftware_install
2 changes: 0 additions & 2 deletions Plugin/mindoc/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,3 @@ DowmPackage_wget
UnPackage_zip
### 验证软件安装
CheckInstalld_file mindoc_linux_amd64
### 配置软件
ConfigSoftware_install
4 changes: 4 additions & 0 deletions Shell/Plugin/Init.sh
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,10 @@ function MakeSoftwareConfigFile_init() {

### 默认初始化软件流程
function InitSoftware_default(){
# 创建用户
sudo groupadd -f ${SoftwareGroup}
id -u ${SoftwareUser} > /dev/null 2>&1
[ $? -ne 0 ] && sudo useradd -m -g ${SoftwareGroup} ${SoftwareUser}
# 创建配置文件目录
sudo mkdir -p $(dirname ${SoftwareConfigFile})
# 创建数据目录
Expand Down
12 changes: 0 additions & 12 deletions Shell/Plugin/Install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -62,15 +62,3 @@ function CheckInstalld_file() {
exit 1
fi
}

### 配置配置
function ConfigSoftware_install(){
# 用户组及用户
sudo groupadd -f ${SoftwareGroup}
id -u ${SoftwareUser} > /dev/null 2>&1
[ $? -ne 0 ] && sudo useradd -m -g ${SoftwareGroup} ${SoftwareUser}
# 用户目录权限
sudo chown ${SoftwareUser}.${SoftwareGroup} /home/${SoftwareUser}
# 软件安装目录权限
sudo chown -R ${SoftwareUser}.${SoftwareGroup} ${SoftwarePathInstall}
}

0 comments on commit e1f29e6

Please sign in to comment.