Skip to content

Commit

Permalink
fix: 修正数据库检测
Browse files Browse the repository at this point in the history
  • Loading branch information
wojiushixiaobai committed Jul 16, 2024
1 parent 027b67e commit ed89f92
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion scripts/utils.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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"
Expand Down

0 comments on commit ed89f92

Please sign in to comment.