Skip to content

Commit

Permalink
create: add group only if not existing
Browse files Browse the repository at this point in the history
  • Loading branch information
89luca89 committed Dec 8, 2021
1 parent c9f13bc commit a6bb8d9
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion distrobox-init
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,9 @@ echo "${container_user_name} ALL = (root) NOPASSWD:ALL" >>/etc/sudoers

# Let's add our user to the container
# if the user already exists, just add it to the sudoers groups
groupadd --force --gid "${container_user_uid}" "${container_user_name}"
if ! grep -q "${container_user_name}" /etc/group; then
groupadd --force --gid "${container_user_uid}" "${container_user_name}"
fi
if ! useradd \
--home-dir "${container_user_home}" \
--no-create-home \
Expand Down

0 comments on commit a6bb8d9

Please sign in to comment.