diff --git a/scripts/change_url b/scripts/change_url index 2bffcab..207197d 100644 --- a/scripts/change_url +++ b/scripts/change_url @@ -27,6 +27,8 @@ app=$YNH_APP_INSTANCE_NAME ynh_script_progression --message="Loading installation settings..." --weight=1 final_path=$(ynh_app_setting_get --app=$app --key=final_path) +db_name=$(ynh_app_setting_get --app=$app --key=db_name) +db_pwd=$(ynh_app_setting_get --app=$app --key=db_pwd) #================================================= # CHECK WHICH PARTS SHOULD BE CHANGED @@ -80,13 +82,15 @@ fi #================================================= ynh_script_progression --message="Configuring ttrss..." --weight=1 +domain="$new_domain" +path_url="$new_path" + cp ../conf/config.php "$final_path/config.php" # Change domain name in config.php ynh_replace_string --match_string="__DBNAME__" --replace_string="$db_name" --target_file="$final_path/config.php" ynh_replace_string --match_string="__DBPWD__" --replace_string="$db_pwd" --target_file="$final_path/config.php" ynh_replace_string --match_string="__DOMAINPATH__" --replace_string="https://$domain$path_url" --target_file="$final_path/config.php" -ynh_replace_string --match_string="define('SELF_URL_PATH'.*" --replace_string="define('SELF_URL_PATH', 'https://$new_domain$new_path');" --target_file="$final_path/config.php" # Recalculate and store the config file checksum into the app settings ynh_store_file_checksum --file="$final_path/config.php"