From b0324507248dd0d32ab099c5f792580a9382b81a Mon Sep 17 00:00:00 2001 From: casjay Date: Mon, 2 Sep 2024 09:46:58 -0400 Subject: [PATCH] =?UTF-8?q?=F0=9F=97=83=EF=B8=8F=20Committing=20everything?= =?UTF-8?q?=20that=20changed=20=F0=9F=97=83=EF=B8=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit rootfs/usr/local/etc/docker/functions/entrypoint.sh --- .../usr/local/etc/docker/functions/entrypoint.sh | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/rootfs/usr/local/etc/docker/functions/entrypoint.sh b/rootfs/usr/local/etc/docker/functions/entrypoint.sh index 77ed5ab..df8b081 100644 --- a/rootfs/usr/local/etc/docker/functions/entrypoint.sh +++ b/rootfs/usr/local/etc/docker/functions/entrypoint.sh @@ -203,6 +203,8 @@ __display_user_info() { # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - __init_config_etc() { local COPY="no" + local ETC_DIR="${ETC_DIR:-/etc}" + local CONF_DIR="${CONF_DIR:-/config}" __is_dir_empty "$CONF_DIR" && COPY=yes if [ ! -d "$CONF_DIR" ] || [ "$COPY" = "yes" ]; then if [ -d "$ETC_DIR" ]; then @@ -1033,11 +1035,9 @@ __check_service() { } # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - __switch_to_user() { - if [ "$RUNAS_USER" = "roo t" ]; then - su_cmd() { - su_exec="" - eval "$@" || return 1 - } + if [ "$RUNAS_USER" = "root" ]; then + su_exec="" + su_cmd() { eval "$@" || return 1; } elif [ "$(builtin type -P gosu)" ]; then su_exec="gosu $RUNAS_USER" su_cmd() { gosu $RUNAS_USER "$@" || return 1; } @@ -1051,10 +1051,8 @@ __switch_to_user() { su_exec="su -s /bin/sh - $RUNAS_USER" su_cmd() { su -s /bin/sh - $RUNAS_USER -c "$@" || return 1; } else - su_cmd() { - su_exec="" - echo "Can not switch to $RUNAS_USER: attempting to run as root" && eval "$@" || return 1 - } + su_exec="" + su_cmd() { echo "Can not switch to $RUNAS_USER: attempting to run as root" && eval "$@" || return 1; } fi export su_exec }