From ed89f922827e7230ec383e648ac564c88f0d5f3d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=90=B4=E5=B0=8F=E7=99=BD?= <296015668@qq.com> Date: Tue, 16 Jul 2024 12:01:44 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E6=AD=A3=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E5=BA=93=E6=A3=80=E6=B5=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- scripts/utils.sh | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/scripts/utils.sh b/scripts/utils.sh index e810597b..2bb76fc9 100644 --- a/scripts/utils.sh +++ b/scripts/utils.sh @@ -107,6 +107,15 @@ function disable_config() { fi } +function check_volume_dir() { + volume_dir=$(get_config VOLUME_DIR) + if [[ -d "${volume_dir}" ]]; then + echo "1" + else + echo "0" + fi +} + function check_db_data() { db_type=$1 if [[ ! -f "${CONFIG_FILE}" ]]; then @@ -124,7 +133,11 @@ function get_db_info() { info_type=$1 db_engine=$(get_config DB_ENGINE "mysql") db_host=$(get_config DB_HOST) - + check_volume_dir=$(check_volume_dir) + if [[ "${check_volume_dir}" == "0" ]]; then + db_engine=$(get_config DB_ENGINE "postgresql") + fi + mysql_data_exists="0" mariadb_data_exists="0" postgres_data_exists="0"