Commit d66e26cb authored by Adrien Delsalle's avatar Adrien Delsalle Committed by GitHub

updates on start.sh file

typo correction on env variable: replacing $USER with $NB_USER since $USER is not set
test if group exists before trying to add a new group
parent be4674ff
......@@ -77,11 +77,13 @@ if [ $(id -u) == 0 ] ; then
fi
# Change UID:GID of NB_USER to NB_UID:NB_GID if it does not match
if [ "$NB_UID" != $(id -u $NB_USER) ] || [ "$NB_GID" != $(id -g $NB_USER) ] ; then
if [ "$NB_UID" != $(id -u $NB_USER) ] || [ "$NB_GID" != $(id -g $NB_USER) ]; then
echo "Set user $NB_USER UID:GID to: $NB_UID:$NB_GID"
if [ "$NB_GID" != $(id -g $NB_USER) ]; then
groupadd -g $NB_GID -o ${NB_GROUP:-${NB_USER}}
fi
userdel $NB_USER
groupadd -g $NB_GID -o ${NB_GROUP:-${NB_USER}}
useradd --home /home/$USER -u $NB_UID -g $NB_GID -G 100 -l $NB_USER
useradd --home /home/$NB_USER -u $NB_UID -g $NB_GID -G 100 -l $NB_USER
fi
# Enable sudo if requested
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment