diff --git a/scripts/change_url b/scripts/change_url index 607333d..6d8700b 100755 --- a/scripts/change_url +++ b/scripts/change_url @@ -25,6 +25,9 @@ ynh_change_url_nginx_config # UPDATE CONFIGURATION FILE #================================================= +# Add newline at end of file if required +sed -i -e '$a\' "$data_dir/config.xml" + ynh_replace_string --match_string="$old_path" --replace_string="$new_path" --target_file="$data_dir/config.xml" #================================================= diff --git a/scripts/install b/scripts/install index 12f220e..b22abf1 100755 --- a/scripts/install +++ b/scripts/install @@ -68,9 +68,6 @@ ynh_script_progression --message="Starting $app's systemd service..." --weight=2 # Start a systemd service ynh_systemd_action --service_name="$app" --action="start" --log_path="systemd" --line_match="CommandExecutor: Starting" -# FIXME Update config.xml checksum, for a mere file ending with or without a new line... -ynh_store_file_checksum --file="$data_dir/config.xml" - #================================================= # END OF SCRIPT #================================================= diff --git a/scripts/restore b/scripts/restore index cef1846..b8df9d7 100755 --- a/scripts/restore +++ b/scripts/restore @@ -65,9 +65,6 @@ ynh_systemd_action --service_name="$app" --action="start" --log_path="systemd" - ynh_systemd_action --service_name=nginx --action=reload -# FIXME Update config.xml checksum, for a mere file ending with or without a new line... -ynh_store_file_checksum --file="$data_dir/config.xml" - #================================================= # END OF SCRIPT #================================================= diff --git a/scripts/upgrade b/scripts/upgrade index ce3232b..c7801c3 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -30,6 +30,9 @@ chown -R "$app:" "$install_dir" #================================================= ynh_script_progression --message="Updating the configuration file..." --weight=1 +# Add newline at end of file if required +sed -i -e '$a\' "$data_dir/config.xml" + ynh_add_config --template="config.xml" --destination="$data_dir/config.xml" chmod 400 "$data_dir/config.xml" @@ -58,9 +61,6 @@ ynh_script_progression --message="Starting $app's systemd service..." --weight=1 ynh_systemd_action --service_name="$app" --action="start" --log_path="systemd" --line_match="CommandExecutor: Starting" -# FIXME Update config.xml checksum, for a mere file ending with or without a new line... -ynh_store_file_checksum --file="$data_dir/config.xml" - #================================================= # END OF SCRIPT #=================================================