From 32a74858c60850b45313eb8c155d90ef02795c56 Mon Sep 17 00:00:00 2001 From: OniriCorpe Date: Fri, 23 Feb 2024 03:13:53 +0100 Subject: [PATCH] patch the config file to add the friendica logs --- scripts/upgrade | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/scripts/upgrade b/scripts/upgrade index b8c748d..087819f 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -84,7 +84,14 @@ fi # add the path to the pidfile if missing if [ -f "$install_dir/config/local.config.php" ] && ! grep -q -e "pidfile" "$install_dir/config/local.config.php"; then ynh_print_info --message="Patching the Friendica config file: add the PID file path for the daemon..." - ynh_replace_string --match_string="'basepath' => '$install_dir'," --replace_string="'basepath' => '$install_dir',\n 'pidfile' => '$install_dir/daemon.pid'," --target_file="$install_dir/config/local.config.php" + ynh_replace_string --match_string="'basepath' => '$install_dir'," --replace_string="'basepath' => '$install_dir',\n 'pidfile' => '$install_dir/daemon.pid',\n" --target_file="$install_dir/config/local.config.php" + ynh_store_file_checksum --file="$install_dir/config/local.config.php" +fi + +# add log path to the config +if [ -f "$install_dir/config/local.config.php" ] && ! grep -q -e "logfile" "$install_dir/config/local.config.php"; then + ynh_print_info --message="Patching the Friendica config file: add the path for the Friendica logfile..." + ynh_replace_string --match_string="'basepath' => '$install_dir'," --replace_string="'basepath' => '$install_dir',\n 'logfile' => '/var/log/friendica/friendica.log',\n 'loglevel' => 'notice',\n" --target_file="$install_dir/config/local.config.php" ynh_store_file_checksum --file="$install_dir/config/local.config.php" fi