Tweaked docker-init.sh to create a needed GID entry before using it when creating a new user.

- Legacy-Id: 17030
This commit is contained in:
Henrik Levkowetz 2019-11-16 06:26:40 +00:00
parent d4b96188ea
commit 873494b2d7

View file

@ -71,15 +71,15 @@ if [ ! -d $MYSQLDIR/ietf_utf8 ]; then
fi
fi
if ! grep -q ":$GID:$" /etc/group ; then
echo "Creating group entry for GID '$GID' ..."
groupadd -g "$GID" "$USER"
fi
if ! id -u "$USER" &> /dev/null; then
echo "Creating user '$USER' ..."
useradd -s /bin/bash --groups staff,sudo --uid $UID --gid $GID $USER
echo "$USER:$USER" | chpasswd
fi
if ! grep -q ":$GID:$" /etc/group ; then
echo "Creating group entry for GID '$GID' ..."
groupadd -g $GID users
fi
VIRTDIR="/opt/home/$USER/$TAG"
echo "Checking that there's a virtual environment for $TAG ..."