From 085c8fecadf389f0501656dc7fa471f497c07200 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Fri, 30 Sep 2022 12:07:09 +0200 Subject: [PATCH] Update _common.sh --- scripts/_common.sh | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/scripts/_common.sh b/scripts/_common.sh index dbf423a..a409d5d 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -17,19 +17,19 @@ mysql-to-pg() { ynh_script_progression --message="Migrating to PostgreSQL database..." --weight=10 - db_pwd=$(ynh_app_setting_get --app=$app --key=mysqlpwd) + mysqlpwd=$(ynh_app_setting_get --app=$app --key=mysqlpwd) #postgresql_db_pwd=$(ynh_string_random --length=24) ynh_psql_test_if_first_run - ynh_psql_setup_db --db_user=$db_user --db_name=$db_name --db_pwd=$db_pwd - db_pwd=$(ynh_app_setting_get --app=$app --key=db_pwd) + ynh_psql_setup_db --db_user=$db_user --db_name=$db_name + psqlpwd=$(ynh_app_setting_get --app=$app --key=psqlpwd) # Migrating from MySQL to PostgreSQL - pgloader mysql://$db_user:$db_pwd@localhost:3306/$db_name postgresql://$db_user:$db_pwd@localhost:5432/$db_name + pgloader mysql://$db_user:$mysqlpwd@localhost:3306/$db_name postgresql://$db_user:$psqlpwd@localhost:5432/$db_name ynh_replace_string --match_string="\"DriverName\":*," --replace_string="\"DriverName\": \"postgres\"," --target_file="$final_path/config/config.json" - ynh_replace_string --match_string="\"DataSource\":*," --replace_string="\"DataSource\": \"postgres://$db_user:$db_pwd@localhost:5432/$db_name?sslmode=disable&connect_timeout=10\"," --target_file="$final_path/config/config.json" + ynh_replace_string --match_string="\"DataSource\":*," --replace_string="\"DataSource\": \"postgres://$db_user:$psqlpwd@localhost:5432/$db_name?sslmode=disable&connect_timeout=10\"," --target_file="$final_path/config/config.json" #================================================= # MODIFY A CONFIG FILE