From f773833aaba871a1ce34ee3641e5cb5f8fa5a5a3 Mon Sep 17 00:00:00 2001 From: lizw <1183409807@qq.com> Date: Sun, 30 Oct 2022 17:06:19 +0800 Subject: [PATCH] 07env-install-centos.sh --- 00base/07env-install-centos.sh | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/00base/07env-install-centos.sh b/00base/07env-install-centos.sh index cf3f929..d2ee8cc 100644 --- a/00base/07env-install-centos.sh +++ b/00base/07env-install-centos.sh @@ -237,8 +237,7 @@ function init:add_user() { # 设置密码 echo ${ADD_USER_NAME}:${ADD_USER_PASSWORD} | chpasswd fi - grep -c '$add_sudoers' '/etc/sudoers' - if [ \$? -ne 0 ];then + if [ \`grep -c '$add_sudoers' '/etc/sudoers'\` -ne 0 ];then # 新增修改权限 chmod -v u+w /etc/sudoers echo -e \"\n$add_sudoers\n\" >> /etc/sudoers