From 606671cb42ed893fd3331ad0d0b3bd22d5ccbddc Mon Sep 17 00:00:00 2001 From: tituspijean Date: Sun, 30 Jun 2024 16:47:38 +0200 Subject: [PATCH] Do not overwrite the configuration file --- scripts/change_url | 7 +------ scripts/upgrade | 11 ----------- 2 files changed, 1 insertion(+), 17 deletions(-) diff --git a/scripts/change_url b/scripts/change_url index 740c329..c559e20 100644 --- a/scripts/change_url +++ b/scripts/change_url @@ -32,12 +32,7 @@ ynh_change_url_nginx_config #================================================= ynh_script_progression --message="Updating a configuration file..." -path=$new_path -domain=$new_domain -ynh_add_config --template="../conf/headphones.ini" --destination="/etc/$app/headphones.ini" - -chmod 600 "/etc/$app/headphones.ini" -chown $app:$app "/etc/$app/headphones.ini" +ynh_replace_string --match_string="^http_root = .*" --replace_string="http_root = $new_path" --target_file="/etc/$app/headphones.ini" #================================================= # GENERIC FINALISATION diff --git a/scripts/upgrade b/scripts/upgrade index f7a3043..9e4b0df 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -58,17 +58,6 @@ ynh_script_progression --message="Installing Python dependencies..." ynh_secure_remove --file="$install_dir/venv" python3 -m venv $install_dir/venv -#================================================= -# UPDATE A CONFIG FILE -#================================================= -ynh_script_progression --message="Updating a configuration file..." - -mkdir -p "/etc/$app" -ynh_add_config --template="../conf/headphones.ini" --destination="/etc/$app/headphones.ini" - -chmod 600 "/etc/$app/headphones.ini" -chown $app:$app "/etc/$app/headphones.ini" - #================================================= # SETUP SYSTEMD #=================================================