fix userid comparisons

This commit is contained in:
Kyle Spearrin 2018-04-16 16:26:54 -04:00
parent 05cc9b45e6
commit 14bac6a744
1 changed files with 2 additions and 3 deletions

View File

@ -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 ]