diff --git a/app/entrypoint.sh b/app/entrypoint.sh index 8360c44..7935f3b 100644 --- a/app/entrypoint.sh +++ b/app/entrypoint.sh @@ -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 "#"