From 4a50da79d3f812af9d9b8c7c33f0d226c954a6a9 Mon Sep 17 00:00:00 2001 From: tituspijean Date: Sat, 6 Apr 2024 20:49:08 +0200 Subject: [PATCH] hotfix: do not fail if config file is missing --- scripts/change_url | 4 +++- scripts/upgrade | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/scripts/change_url b/scripts/change_url index 0b00c85..8fcddde 100644 --- a/scripts/change_url +++ b/scripts/change_url @@ -32,7 +32,9 @@ ynh_change_url_nginx_config #================================================= # Add newline at end of file if required -sed -i -e '$a\' "$data_dir/config.xml" +if [ -e "$data_dir/config.xml" ]; then + sed -i -e '$a\' "$data_dir/config.xml" +fi ynh_add_config --template="config.xml" --destination="$data_dir/config.xml" diff --git a/scripts/upgrade b/scripts/upgrade index 7ae6a1c..6c97389 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -61,7 +61,9 @@ ynh_use_logrotate --non-append --logfile="/var/log/$app/" ynh_script_progression --message="Configuring Radarr..." --weight=2 # Add newline at end of file if required -sed -i -e '$a\' "$data_dir/config.xml" +if [ -e "$data_dir/config.xml" ]; then + sed -i -e '$a\' "$data_dir/config.xml" +fi ynh_add_config --template="config.xml" --destination="$data_dir/config.xml"