🗃️ Committing everything that changed 🗃️

rootfs/usr/local/etc/docker/functions/entrypoint.sh
This commit is contained in:
casjay 2023-09-03 19:24:59 -04:00
parent 29de1a4e51
commit 787d968d8b
Signed by untrusted user who does not match committer: jason
GPG Key ID: 1AB309F42A764145

View File

@ -396,14 +396,10 @@ __set_user_group_id() {
local set_gid="${3:-${SERVICE_GID:-10000}}" local set_gid="${3:-${SERVICE_GID:-10000}}"
local random_id="$(__generate_random_uids)" local random_id="$(__generate_random_uids)"
local exitStatus=0 local exitStatus=0
[ -n "$set_user" ] && [ -n "$set_uid" ] && [ -n "$set_gid" ] || return
[ -n "$set_user" ] && [ "$set_user" != "root" ] || return [ -n "$set_user" ] && [ "$set_user" != "root" ] || return
if [ -z "$set_uid" ] || [ "$set_uid" = "0" ]; then { [ -n "$set_uid" ] && [ "$set_uid" != "0" ]; } || return
set_uid="$random_id" { [ -n "$set_gid" ] && [ "$set_gid" != "0" ]; } || return
fi [ -n "$set_user" ] && [ -n "$set_uid" ] && [ -n "$set_gid" ] || return
if [ -z "$set_gid" ] || [ "$set_gid" = "0" ]; then
set_gid="$random_id"
fi
if grep -sq "^$set_user:" "/etc/passwd" "/etc/group"; then if grep -sq "^$set_user:" "/etc/passwd" "/etc/group"; then
if ! grep -sq "x:.*:$set_gid:" "/etc/group"; then if ! grep -sq "x:.*:$set_gid:" "/etc/group"; then
groupmod -g "${set_gid}" $set_user | tee -p -a "${LOG_DIR/tmp/}/init.txt" &>/dev/null groupmod -g "${set_gid}" $set_user | tee -p -a "${LOG_DIR/tmp/}/init.txt" &>/dev/null