fix: Suppress useradd/groupadd errors (#4408)

This commit is contained in:
Lars Eggert 2022-09-06 20:04:30 +03:00 committed by GitHub
parent 9f0e5d1a65
commit 743484fb4c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -193,14 +193,14 @@ if id -u ${USERNAME} > /dev/null 2>&1; then
else
# Create user
if [ "${USER_GID}" = "automatic" ]; then
groupadd $USERNAME
groupadd --force $USERNAME
else
groupadd --gid $USER_GID $USERNAME
groupadd --force --gid $USER_GID $USERNAME
fi
if [ "${USER_UID}" = "automatic" ]; then
useradd -s /bin/bash --gid $USERNAME -m $USERNAME
useradd -s /bin/bash --gid $USERNAME -m $USERNAME || true
else
useradd -s /bin/bash --uid $USER_UID --gid $USERNAME -m $USERNAME
useradd -s /bin/bash --uid $USER_UID --gid $USERNAME -m $USERNAME || true
fi
fi