Commit 6d42503c authored by Romain's avatar Romain Committed by GitHub

Merge pull request #1152 from jgwerner/fix/update-start-gid

Add -f option with groupadd to gracefully exit when adding existing groups
parents b2562c46 e95f3c5e
...@@ -80,7 +80,7 @@ if [ $(id -u) == 0 ] ; then ...@@ -80,7 +80,7 @@ if [ $(id -u) == 0 ] ; then
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" echo "Set user $NB_USER UID:GID to: $NB_UID:$NB_GID"
if [ "$NB_GID" != $(id -g $NB_USER) ]; then 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 fi
userdel $NB_USER userdel $NB_USER
useradd --home /home/$NB_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
......
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