🗃️ Committing everything that changed 🗃️

rootfs/usr/local/etc/docker/functions/entrypoint.sh
This commit is contained in:
casjay 2024-09-02 09:46:58 -04:00
parent 031abd9bac
commit b032450724
Signed by untrusted user who does not match committer: jason
GPG Key ID: 1AB309F42A764145

View File

@ -203,6 +203,8 @@ __display_user_info() {
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
__init_config_etc() { __init_config_etc() {
local COPY="no" local COPY="no"
local ETC_DIR="${ETC_DIR:-/etc}"
local CONF_DIR="${CONF_DIR:-/config}"
__is_dir_empty "$CONF_DIR" && COPY=yes __is_dir_empty "$CONF_DIR" && COPY=yes
if [ ! -d "$CONF_DIR" ] || [ "$COPY" = "yes" ]; then if [ ! -d "$CONF_DIR" ] || [ "$COPY" = "yes" ]; then
if [ -d "$ETC_DIR" ]; then if [ -d "$ETC_DIR" ]; then
@ -1033,11 +1035,9 @@ __check_service() {
} }
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
__switch_to_user() { __switch_to_user() {
if [ "$RUNAS_USER" = "roo t" ]; then if [ "$RUNAS_USER" = "root" ]; then
su_cmd() {
su_exec="" su_exec=""
eval "$@" || return 1 su_cmd() { eval "$@" || return 1; }
}
elif [ "$(builtin type -P gosu)" ]; then elif [ "$(builtin type -P gosu)" ]; then
su_exec="gosu $RUNAS_USER" su_exec="gosu $RUNAS_USER"
su_cmd() { gosu $RUNAS_USER "$@" || return 1; } su_cmd() { gosu $RUNAS_USER "$@" || return 1; }
@ -1051,10 +1051,8 @@ __switch_to_user() {
su_exec="su -s /bin/sh - $RUNAS_USER" su_exec="su -s /bin/sh - $RUNAS_USER"
su_cmd() { su -s /bin/sh - $RUNAS_USER -c "$@" || return 1; } su_cmd() { su -s /bin/sh - $RUNAS_USER -c "$@" || return 1; }
else else
su_cmd() {
su_exec="" su_exec=""
echo "Can not switch to $RUNAS_USER: attempting to run as root" && eval "$@" || return 1 su_cmd() { echo "Can not switch to $RUNAS_USER: attempting to run as root" && eval "$@" || return 1; }
}
fi fi
export su_exec export su_exec
} }