From 3a7639ed15b285b6540a7bf9bb887fa243218646 Mon Sep 17 00:00:00 2001 From: casjay Date: Mon, 12 Aug 2024 20:18:22 -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 | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/rootfs/usr/local/etc/docker/functions/entrypoint.sh b/rootfs/usr/local/etc/docker/functions/entrypoint.sh index b13fbf6..11757dd 100644 --- a/rootfs/usr/local/etc/docker/functions/entrypoint.sh +++ b/rootfs/usr/local/etc/docker/functions/entrypoint.sh @@ -21,7 +21,6 @@ # shellcheck disable=SC2016 # shellcheck disable=SC2031 # shellcheck disable=SC2120 -# shellcheck disable=SC2153 # shellcheck disable=SC2155 # shellcheck disable=SC2199 # shellcheck disable=SC2317 @@ -192,7 +191,7 @@ __certbot() { } # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - __init_config_etc() { - if __is_dir_empty "${CONF_DIR}" || [ ! -d "$CONF_DIR" ]; then + if __is_dir_empty "$CONF_DIR" || [ ! -d "$CONF_DIR" ]; then if [ -d "$ETC_DIR" ]; then mkdir -p "$CONF_DIR" __copy_templates "$ETC_DIR/." "$CONF_DIR/" @@ -812,6 +811,18 @@ __initialize_database() { __find_replace "REPLACE_DATABASE_ROOT_PASS" "$db_admin_pass" "$dir" __find_replace "REPLACE_DATABASE_NAME" "$DATABASE_NAME" "$dir" __find_replace "REPLACE_DATABASE_DIR" "$DATABASE_DIR" "$dir" + if echo "$dir" | grep -q '^/etc'; then + __find_replace "REPLACE_USER_NAME" "$db_normal_user" "/etc" + __find_replace "REPLACE_USER_PASS" "$db_normal_pass" "/etc" + __find_replace "REPLACE_DATABASE_USER" "$db_normal_user" "/etc" + __find_replace "REPLACE_DATABASE_PASS" "$db_normal_pass" "/etc" + __find_replace "REPLACE_ROOT_ADMIN" "$db_admin_user" "/etc" + __find_replace "REPLACE_ROOT_PASS" "$db_admin_pass" "/etc" + __find_replace "REPLACE_DATABASE_ROOT_USER" "$db_admin_user" "/etc" + __find_replace "REPLACE_DATABASE_ROOT_PASS" "$db_admin_pass" "/etc" + __find_replace "REPLACE_DATABASE_NAME" "$DATABASE_NAME" "/etc" + __find_replace "REPLACE_DATABASE_DIR" "$DATABASE_DIR" "/etc" + fi } # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - __initialize_db_users() {