Explorar el Código

07env-install-centos.sh

lizw hace 2 años
padre
commit
6aa95f29a7
Se han modificado 1 ficheros con 2 adiciones y 1 borrados
  1. 2 1
      00base/07env-install-centos.sh

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