Skip to content

Commit 873494b

Browse files
committed
Tweaked docker-init.sh to create a needed GID entry before using it when creating a new user.
- Legacy-Id: 17030
1 parent d4b9618 commit 873494b

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

docker/docker-init.sh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -71,15 +71,15 @@ if [ ! -d $MYSQLDIR/ietf_utf8 ]; then
7171
fi
7272
fi
7373

74+
if ! grep -q ":$GID:$" /etc/group ; then
75+
echo "Creating group entry for GID '$GID' ..."
76+
groupadd -g "$GID" "$USER"
77+
fi
7478
if ! id -u "$USER" &> /dev/null; then
7579
echo "Creating user '$USER' ..."
7680
useradd -s /bin/bash --groups staff,sudo --uid $UID --gid $GID $USER
7781
echo "$USER:$USER" | chpasswd
7882
fi
79-
if ! grep -q ":$GID:$" /etc/group ; then
80-
echo "Creating group entry for GID '$GID' ..."
81-
groupadd -g $GID users
82-
fi
8383

8484
VIRTDIR="/opt/home/$USER/$TAG"
8585
echo "Checking that there's a virtual environment for $TAG ..."

0 commit comments

Comments
 (0)