This commit is contained in:
cirry 2023-12-12 15:52:42 +08:00
parent 4ea882d4d0
commit 312d32e256

View File

@ -22,13 +22,13 @@ customAddUser() {
#使用 stty echo 打开 shell 的回显功能
# read -s -p "请输入密码:" pass
# pass=${pass:-123456}
useradd $user
adduser $user
echo -e "\n"
# echo $user:$pass | chpasswd
if [[ $? -eq 0 ]]; then
read -p "是否将用户添加入sudo组?(y/n)" confirmAdd
if [[ "$confirmAdd" == `echo -e "\n"` || $confirmAdd == "Y" || $confirmAdd == "y" ]]; then
usermod -aG sudo cirry
usermod -aG sudo $user
fi
else
return $?