Skip to content
This repository has been archived by the owner on Mar 15, 2024. It is now read-only.

Commit

Permalink
fix userid comparisons
Browse files Browse the repository at this point in the history
  • Loading branch information
kspearrin committed Apr 16, 2018
1 parent 05cc9b4 commit 14bac6a
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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 ]
Expand Down

0 comments on commit 14bac6a

Please sign in to comment.