From 1999b25f77463719677740b1666dcb3b392bdf6d Mon Sep 17 00:00:00 2001 From: sindoring Date: Sun, 26 Apr 2026 19:33:53 +0400 Subject: [PATCH] fix --- scripts/db-backup.sh | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/scripts/db-backup.sh b/scripts/db-backup.sh index 17effd4..ac1663b 100755 --- a/scripts/db-backup.sh +++ b/scripts/db-backup.sh @@ -76,9 +76,14 @@ load_target() { DB_NAME="$(env_get DB_DATABASE "$ENV_FILE")" DB_USER="$(env_get DB_USERNAME "$ENV_FILE")" DB_PASS="$(env_get DB_PASSWORD "$ENV_FILE")" - if [[ "$DB_HOST" == "mysql" ]]; then + local fwd_port + fwd_port="$(env_get FORWARD_DB_PORT "$ENV_FILE")" + if [[ "$DB_HOST" == "mysql" ]] || + [[ "$DB_HOST" == "host.docker.internal" ]] || + [[ "$DB_HOST" == "127.0.0.1" && -n "$fwd_port" && "${DB_PORT:-3306}" == "$fwd_port" ]] || + [[ "$DB_HOST" == "localhost" && -n "$fwd_port" && "${DB_PORT:-3306}" == "$fwd_port" ]]; then DB_DOCKER_SERVICE="mysql" - DB_DOCKER_PORT="${DB_PORT:-3306}" + DB_DOCKER_PORT="3306" fi ;; auth)