From 6aa95f29a7be261813cf3020127652b2e378eabc Mon Sep 17 00:00:00 2001 From: lizw <1183409807@qq.com> Date: Sun, 30 Oct 2022 17:01:49 +0800 Subject: [PATCH] 07env-install-centos.sh --- 00base/07env-install-centos.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/00base/07env-install-centos.sh b/00base/07env-install-centos.sh index a3e1874..5e7d959 100644 --- a/00base/07env-install-centos.sh +++ b/00base/07env-install-centos.sh @@ -230,7 +230,8 @@ function init:add_user() { local host="127.0.0.1" local add_sudoers="${ADD_USER_NAME} ALL=(ALL) NOPASSWD:ALL" command::exec "${host}" " - if [ \`id -u ${ADD_USER_NAME} >/dev/null 2>&1\` -ne '0' ]; then + id -u ${ADD_USER_NAME} >/dev/null 2>&1 + if [ \$? -ne 0 ]; then # 创建用户 adduser ${ADD_USER_NAME} # 设置密码