Skip to content

Commit

Permalink
Merge pull request #1152 from jgwerner/fix/update-start-gid
Browse files Browse the repository at this point in the history
Add -f option with groupadd to gracefully exit when adding existing groups
  • Loading branch information
romainx committed Aug 26, 2020
2 parents b2562c4 + e95f3c5 commit 6d42503
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion base-notebook/start.sh
Expand Up @@ -80,7 +80,7 @@ if [ $(id -u) == 0 ] ; 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}}
groupadd -f -g $NB_GID -o ${NB_GROUP:-${NB_USER}}
fi
userdel $NB_USER
useradd --home /home/$NB_USER -u $NB_UID -g $NB_GID -G 100 -l $NB_USER
Expand Down

0 comments on commit 6d42503

Please sign in to comment.