From 99687759278969e0280cc9c51af036a641b22877 Mon Sep 17 00:00:00 2001 From: "flow.gunso" Date: Tue, 9 Apr 2019 14:23:24 +0200 Subject: [PATCH] Invert group modification, redirect getent query to /dev/null --- entrypoint.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/entrypoint.sh b/entrypoint.sh index a94ec8d..c32a7d3 100644 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -36,11 +36,11 @@ if [ "$UID" != "1000" ]; then fi # Change the group, if the $GID changed. if [ "$GID" != "1000" ]; then - getent group | grep ":$GID:" - if [ $? -eq 0 ]; then - groupmod -g $GID $UNAME + getent group | grep ":$GID:" &>/dev/null + if [ $? -eq 1 ]; then + usermod -g $GID -G 1000 $UNAME else - usermod -g $UID -G $GID $UNAME + groupmod -g $GID $UNAME fi fi