From 62ff8b214dbbeaea28db55915331d355ecd551ea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Sun, 5 Mar 2023 09:31:46 +0100 Subject: [PATCH] fix --- scripts/backup | 2 ++ scripts/install | 2 +- scripts/restore | 14 +++++++------- scripts/upgrade | 6 +++++- 4 files changed, 15 insertions(+), 9 deletions(-) diff --git a/scripts/backup b/scripts/backup index ac5b947..3adb9d7 100755 --- a/scripts/backup +++ b/scripts/backup @@ -21,6 +21,8 @@ ynh_print_info --message="Declaring files to be backed up..." ynh_backup --src_path="$install_dir" +ynh_backup --src_path="/etc/opt/simplex" + #================================================= # BACKUP SYSTEMD #================================================= diff --git a/scripts/install b/scripts/install index 2a6f144..dd20ded 100755 --- a/scripts/install +++ b/scripts/install @@ -39,7 +39,7 @@ chown -R $app:$app "/etc/opt/simplex" #================================================= # SYSTEM CONFIGURATION #================================================= -ynh_script_progression --message="Adding system configurations related to $app ..." --weight=1 +ynh_script_progression --message="Adding system configurations related to $app ..." --weight=6 # Create a dedicated systemd config ynh_add_systemd_config diff --git a/scripts/restore b/scripts/restore index 6d34450..6eb851b 100755 --- a/scripts/restore +++ b/scripts/restore @@ -21,18 +21,18 @@ chmod -R o-rwx "$install_dir" chown -R $app:www-data "$install_dir" #================================================= -# RESTORE SYSTEMD +# RESTORE SYSTEM CONFIGURATIONS #================================================= -ynh_script_progression --message="Restoring the systemd configuration..." --weight=1 +# RESTORE THE PHP-FPM CONFIGURATION +#================================================= +ynh_script_progression --message="Restoring system configurations related to $app..." --weight=4 + +ynh_restore_file --origin_path="/etc/opt/simplex" +chown -R $app:$app "/etc/opt/simplex" ynh_restore_file --origin_path="/etc/systemd/system/$app.service" systemctl enable $app.service --quiet -#================================================= -# INTEGRATE SERVICE IN YUNOHOST -#================================================= -ynh_script_progression --message="Integrating service in YunoHost..." --weight=1 - yunohost service add $app --description="Messaging platform" --log="/var/log/$app/$app.log" --needs_exposed_ports="$port" #================================================= diff --git a/scripts/upgrade b/scripts/upgrade index b2d3566..effc4c9 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -16,6 +16,10 @@ source /usr/share/yunohost/helpers upgrade_type=$(ynh_check_app_version_changed) +#================================================= +# STORE SETTINGS +#================================================= + public_ip4="$(curl -s ip.yunohost.org)" || true fingerprint=$(cat /etc/opt/simplex/fingerprint) ynh_app_setting_set --app=$app --key=public_ip4 --value=$public_ip4 @@ -49,7 +53,7 @@ chmod +x $install_dir/smp-server #================================================= # REAPPLY SYSTEM CONFIGURATIONS #================================================= -ynh_script_progression --message="Upgrading system configurations related to $app..." --weight=1 +ynh_script_progression --message="Upgrading system configurations related to $app..." --weight=4 # Create a dedicated systemd config ynh_add_systemd_config