Skip to content

Commit

Permalink
Suppress mail spool/home directory not found error output of userdel
Browse files Browse the repository at this point in the history
  • Loading branch information
meyerj committed Sep 9, 2019
1 parent 054cbc4 commit c520a4e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/rocker/templates/user_snippet.Dockerfile.em
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ RUN apt-get update \

@[if name != 'root']@
RUN existing_user_by_uid=`getent passwd "@(uid)" | cut -f1 -d: || true` && \
if [ -n "${existing_user_by_uid}" ]; then userdel -r "${existing_user_by_uid}"; fi && \
if [ -n "${existing_user_by_uid}" ]; then userdel -r "${existing_user_by_uid}" 2>&1 | grep -v "not found"; fi && \
existing_user_by_name=`getent passwd "@(name)" | cut -f1 -d: || true` && \
if [ -n "${existing_user_by_name}" ]; then userdel -r "${existing_user_by_name}"; fi && \
if [ -n "${existing_user_by_name}" ]; then userdel -r "${existing_user_by_name}" 2>&1 | grep -v "not found"; fi && \
existing_group_by_gid=`getent group "@(gid)" | cut -f1 -d: || true` && \
if [ -z "${existing_group_by_gid}" ]; then \
groupadd -g "@(gid)" "@name"; \
Expand Down

0 comments on commit c520a4e

Please sign in to comment.