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} # 设置密码