From 14bac6a7442a36c333e3d0c3cdfa57b54f6424a8 Mon Sep 17 00:00:00 2001 From: Kyle Spearrin Date: Mon, 16 Apr 2018 16:26:54 -0400 Subject: [PATCH] fix userid comparisons --- entrypoint.sh | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/entrypoint.sh b/entrypoint.sh index ddb5100f74..08cdf5c341 100644 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -8,8 +8,7 @@ USERNAME="bitwarden" CURRENTGID=`getent group $GROUPNAME | cut -d: -f3` LGID=${LOCAL_GID:-999} -CURRENTUID=`id -u $USERNAME` -NOUSER=`$CURRENTUID > /dev/null 2>&1; echo $?` +NOUSER=`id -u $USERNAME > /dev/null 2>&1; echo $?` LUID=${LOCAL_UID:-999} # Step down from host root @@ -38,7 +37,7 @@ fi # Create user and assign group -if [ $NOUSER == 0 ] && [ "$CURRENTUID" != "$LUID" ] +if [ $NOUSER == 0 ] && [ `id -u $USERNAME` != $LUID ] then usermod -u $LUID $USERNAME elif [ $NOUSER == 1 ]