From 56417ce7ce02c7f80c1c6fe10413a960f7b18561 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?F=C3=A9lix=20Pi=C3=A9dallu?= Date: Sun, 20 Feb 2022 10:29:11 +0100 Subject: [PATCH] Fix : restore was forgetting about logrotate --- scripts/restore | 7 +++++++ scripts/upgrade | 5 +++++ 2 files changed, 12 insertions(+) diff --git a/scripts/restore b/scripts/restore index 4317ab3..1f0a726 100644 --- a/scripts/restore +++ b/scripts/restore @@ -168,6 +168,13 @@ else yunohost service add $app --description="Jellyfin media center" --needs_exposed_ports ${needed_ports[@]} fi +#================================================= +# RESTORE THE LOGROTATE CONFIGURATION +#================================================= +ynh_script_progression --message="Restoring the logrotate configuration..." --time --weight=1 + +ynh_restore_file --origin_path="/etc/logrotate.d/$app" + #================================================= # RESTORE USER RIGHTS #================================================= diff --git a/scripts/upgrade b/scripts/upgrade index 264dcbf..0c67654 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -72,6 +72,11 @@ if [ -z "$discovery" ]; then ynh_app_setting_set --app=$app --key=discovery --value=$discovery fi +if [ ! -f "/etc/logrotate.d/$app" ]; then + # Fix possibly missing file due to buggy restore: + ynh_use_logrotate +fi + #================================================= # BACKUP BEFORE UPGRADE THEN ACTIVE TRAP #=================================================