From 8189565ae81ecb9426caa8bb9b08a32fdecfd5d5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Josu=C3=A9=20Tille?= Date: Sat, 27 Apr 2024 00:19:40 +0200 Subject: [PATCH] Fix install/restore --- scripts/install | 20 +++++++++----------- scripts/restore | 25 +++++++++++-------------- 2 files changed, 20 insertions(+), 25 deletions(-) diff --git a/scripts/install b/scripts/install index c01f6d4..16ba4fe 100755 --- a/scripts/install +++ b/scripts/install @@ -25,24 +25,14 @@ if [ -n "$(ls -A $data_dir)" ]; then app_data_dirs="$(echo /home/yunohost.app/*)" fi -#================================================= -# STANDARD MODIFICATIONS -#================================================= -ynh_script_progression --message="Installing packages..." --weight=1 - -# Download package and install it -install_monitorix_package - ynh_systemd_action --service_name="$app" --action=stop --log_path=systemd --timeout=15 -mkdir -p /var/log/new_"${app}" -mv -t /var/log/new_"${app}" /var/log/monitorix* -mv /var/log/new_"${app}" /var/log/"${app}" #================================================= # SYSTEM CONFIGURATION #=================================================รง ynh_script_progression --message="Adding configurations related to $app..." --weight=1 +mkdir -p /etc/monitorix ynh_add_jinja_config --template=monitorix.conf --destination="/etc/monitorix/monitorix.conf" ynh_add_jinja_config --template=nginx_status.conf --destination="$nginx_status_conf" @@ -62,6 +52,14 @@ fi configure_hooks configure_alerts_email +#================================================= +# STANDARD MODIFICATIONS +#================================================= +ynh_script_progression --message="Installing packages..." --weight=1 + +# Download package and install it +install_monitorix_package + #================================================= # GENERIC FINALIZATION #================================================= diff --git a/scripts/restore b/scripts/restore index a5e62fd..69a1eb8 100755 --- a/scripts/restore +++ b/scripts/restore @@ -12,17 +12,6 @@ source ../settings/scripts/experimental_helper.sh source /usr/share/yunohost/helpers load_vars -#================================================= -# RESTORE THE DEPENDENCIES -#================================================= -ynh_script_progression --message="Restoring the dependencies..." --weight=1 - -install_monitorix_package -ynh_systemd_action --service_name="$app" --action=stop --log_path=systemd --timeout=15 -mkdir -p /var/log/new_"${app}" -mv -t /var/log/new_"${app}" /var/log/monitorix* -mv /var/log/new_"${app}" /var/log/"${app}" - ynh_script_progression --message="Configuring databases access..." configure_db @@ -32,15 +21,23 @@ configure_db ynh_script_progression --message="Restoring files" --weight=1 ynh_restore -mkdir -p /var/log/$app -systemctl enable $app.service --quiet +mkdir -p /var/log/"$app" +systemctl enable "$app".service --quiet ynh_script_progression --message="Configuring php fpm access if needed..." if "$phpfpm_installed"; then config_php_fpm fi -yunohost service add $app --description="Monitorix" --log="systemd" +yunohost service add "$app" --description="Monitorix" --log="systemd" + +#================================================= +# RESTORE THE DEPENDENCIES +#================================================= +ynh_script_progression --message="Restoring the dependencies..." --weight=1 + +install_monitorix_package +ynh_systemd_action --service_name="$app" --action=stop --log_path=systemd --timeout=15 #================================================= # GENERIC FINALIZATION