fix crash on container restart
This commit is contained in:
@@ -9,8 +9,13 @@ echo "#"
|
||||
|
||||
if [ "$user" = '0' ]; then
|
||||
mkdir -p /home/$SERVICE_NAME/log /home/$SERVICE_NAME/config
|
||||
addgroup --gid $GID $SERVICE_NAME 2> /dev/null
|
||||
adduser --ingroup $SERVICE_NAME --shell /bin/false --disabled-password --no-create-home --comment "" --uid $UID $SERVICE_NAME
|
||||
|
||||
if id $SERVICE_NAME ; then
|
||||
echo "user still exists"
|
||||
else
|
||||
addgroup --gid $GID $SERVICE_NAME 2> /dev/null
|
||||
adduser --ingroup $SERVICE_NAME --shell /bin/false --disabled-password --no-create-home --comment "" --uid $UID $SERVICE_NAME
|
||||
fi
|
||||
chown -R $SERVICE_NAME:$SERVICE_NAME /home/$SERVICE_NAME || true
|
||||
echo "######################################################"
|
||||
echo "#"
|
||||
|
||||
Reference in New Issue
Block a user