Fix permission issue when creating user

main
Anthony 2023-10-28 00:27:33 +08:00
parent 703c7a3943
commit 214c1414fb
1 changed files with 2 additions and 1 deletions

View File

@ -12,7 +12,8 @@ if id "$USERNAME" &>/dev/null; then
exit 1
fi
# Create user and set password
# Become root and Create user
sudo su
useradd -m -d $ROOT_DIRECTORY $USERNAME
if [ $? -ne 0 ]; then
echo "Failed to create user $USERNAME."