From 6f58a81c999bf3704d643e32f46f144ad7566622 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?E=CC=81ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Thu, 15 Feb 2024 18:41:24 +0100 Subject: [PATCH] fix --- scripts/install | 20 ++++---------------- scripts/remove | 2 +- scripts/restore | 14 ++------------ scripts/upgrade | 9 ++------- 4 files changed, 9 insertions(+), 36 deletions(-) diff --git a/scripts/install b/scripts/install index f19870d..31267f8 100755 --- a/scripts/install +++ b/scripts/install @@ -39,9 +39,12 @@ chown -R $app:www-data "$install_dir" #================================================= ynh_script_progression --message="Configuring NGINX web server..." --weight=1 -# Create a dedicated NGINX config ynh_add_nginx_config +ynh_add_systemd_config + +yunohost service add $app --description="Group-meeting manager" --log="/var/log/$app/$app.log" + #================================================= # ADD A CONFIGURATION #================================================= @@ -63,21 +66,6 @@ pushd $install_dir ynh_exec_warn_less ynh_exec_as $app env $ynh_node_load_PATH yarn build popd -#================================================= -# SETUP SYSTEMD -#================================================= -ynh_script_progression --message="Configuring a systemd service..." --weight=1 - -# Create a dedicated systemd config -ynh_add_systemd_config - -#================================================= -# INTEGRATE SERVICE IN YUNOHOST -#================================================= -ynh_script_progression --message="Integrating service in YunoHost..." --weight=1 - -yunohost service add $app --description="Group-meeting manager" --log="/var/log/$app/$app.log" - #================================================= # START SYSTEMD SERVICE #================================================= diff --git a/scripts/remove b/scripts/remove index 62cd96b..3ec0fc4 100755 --- a/scripts/remove +++ b/scripts/remove @@ -14,8 +14,8 @@ source /usr/share/yunohost/helpers #================================================= # REMOVE SERVICE INTEGRATION IN YUNOHOST #================================================= +ynh_script_progression --message="Removing system configurations related to $app..." --weight=1 -# Remove the service from the list of services known by YunoHost (added from `yunohost service add`) if ynh_exec_warn_less yunohost service status $app >/dev/null then ynh_script_progression --message="Removing $app service integration..." --weight=1 diff --git a/scripts/restore b/scripts/restore index f310bec..56fe274 100755 --- a/scripts/restore +++ b/scripts/restore @@ -20,13 +20,6 @@ ynh_restore_file --origin_path="$install_dir" chmod -R o-rwx "$install_dir" chown -R $app:www-data "$install_dir" -#================================================= -# RESTORE THE NGINX CONFIGURATION -#================================================= -ynh_script_progression --message="Restoring the NGINX web server configuration..." --weight=1 - -ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf" - #================================================= # RESTORE THE POSTGRESQL DATABASE #================================================= @@ -39,6 +32,8 @@ ynh_psql_execute_file_as_root --file="./db.sql" --database=$db_name #================================================= ynh_script_progression --message="Restoring the systemd configuration..." --weight=1 +ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf" + ynh_restore_file --origin_path="/etc/systemd/system/$app.service" systemctl enable $app.service --quiet @@ -49,11 +44,6 @@ ynh_script_progression --message="Integrating service in YunoHost..." --weight=1 yunohost service add $app --description="Group-meeting manager" --log="/var/log/$app/$app.log" -#================================================= -# START SYSTEMD SERVICE -#================================================= -ynh_script_progression --message="Starting a systemd service..." --weight=1 - ynh_systemd_action --service_name=$app --action="start" --log_path="systemd" #================================================= diff --git a/scripts/upgrade b/scripts/upgrade index 4805e09..9f3637e 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -27,14 +27,9 @@ ynh_systemd_action --service_name=$app --action="stop" --log_path="systemd" #================================================= # DOWNLOAD, CHECK AND UNPACK SOURCE #================================================= +ynh_script_progression --message="Upgrading source files..." --weight=1 -if [ "$upgrade_type" == "UPGRADE_APP" ] -then - ynh_script_progression --message="Upgrading source files..." --weight=1 - - # Download, check integrity, uncompress and patch the source from app.src - ynh_setup_source --dest_dir="$install_dir" --keep=".env" -fi +ynh_setup_source --dest_dir="$install_dir" --keep=".env" chmod -R o-rwx "$install_dir" chown -R $app:www-data "$install_dir"