diff --git a/scripts/change_url b/scripts/change_url index b947e02..ee2c2a2 100644 --- a/scripts/change_url +++ b/scripts/change_url @@ -28,7 +28,6 @@ ynh_script_progression --message="Loading installation settings..." --weight=1 # Needed for helper "ynh_add_nginx_config" final_path=$(ynh_app_setting_get --app=$app --key=final_path) -path_url=$(ynh_app_setting_get --app=$app --key=path) port=$(ynh_app_setting_get --app=$app --key=port) db_name=$(ynh_app_setting_get --app=$app --key=db_name) db_user=$db_name @@ -116,15 +115,15 @@ ynh_backup_if_checksum_is_different --file="$final_path/config.json" domain=$new_domain path_url=$new_path -cp ../conf/config.json.example "$final_path/config.json" +ynh_replace_string --match_string="__PORT__" --replace_string="$port" --target_file="../conf/config.json.example" +ynh_replace_string --match_string="__DOMAIN__" --replace_string="$domain" --target_file="../conf/config.json.example" +ynh_replace_string --match_string="__PATH__" --replace_string="${path_url:1}" --target_file="../conf/config.json.example" +ynh_replace_string --match_string="__DB_USER__" --replace_string="$db_user" --target_file="../conf/config.json.example" +ynh_replace_string --match_string="__DB_NAME__" --replace_string="$db_name" --target_file="../conf/config.json.example" +ynh_replace_string --match_string="__DB_PASS__" --replace_string="$db_pwd" --target_file="../conf/config.json.example" +ynh_replace_string --match_string="__APP__" --replace_string="$app" --target_file="../conf/config.json.example" -ynh_replace_string --match_string="__PORT__" --replace_string="$port" --target_file="$final_path/config.json" -ynh_replace_string --match_string="__DOMAIN__" --replace_string="$domain" --target_file="$final_path/config.json" -ynh_replace_string --match_string="__PATH__" --replace_string="${path_url%/}" --target_file="$final_path/config.json" -ynh_replace_string --match_string="__DB_USER__" --replace_string="$db_user" --target_file="$final_path/config.json" -ynh_replace_string --match_string="__DB_NAME__" --replace_string="$db_name" --target_file="$final_path/config.json" -ynh_replace_string --match_string="__DB_PASS__" --replace_string="$db_pwd" --target_file="$final_path/config.json" -ynh_replace_string --match_string="__APP__" --replace_string="$app" --target_file="$final_path/config.json" +cp ../conf/config.json.example "$final_path/config.json" ynh_store_file_checksum --file="$final_path/config.json"