From 87af26f98f4e4698f0ee3d5a3f411fd4f309f417 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?E=CC=81ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Tue, 27 Jun 2023 10:03:42 +0200 Subject: [PATCH] fix --- scripts/remove | 44 +------------------------------------------- scripts/restore | 36 +----------------------------------- 2 files changed, 2 insertions(+), 78 deletions(-) diff --git a/scripts/remove b/scripts/remove index 1d87930..aa20db8 100644 --- a/scripts/remove +++ b/scripts/remove @@ -14,6 +14,7 @@ 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 @@ -22,62 +23,19 @@ then yunohost service remove $app fi -#================================================= -# STOP AND REMOVE SERVICE -#================================================= -ynh_script_progression --message="Stopping and removing the systemd service..." --weight=1 - # Remove the dedicated systemd config ynh_remove_systemd_config -#================================================= -# REMOVE LOGROTATE CONFIGURATION -#================================================= -ynh_script_progression --message="Removing logrotate configuration..." --weight=1 - # Remove the app-specific logrotate config ynh_remove_logrotate -#================================================= -# REMOVE DEPENDENCIES -#================================================= - -if [ "$export" != "none" ] -then -#REMOVEME? ynh_script_progression --message="Removing dependencies..." --weight=20 - # Remove metapackage and its dependencies -#REMOVEME? ynh_exec_warn_less ynh_remove_app_dependencies -fi - -#================================================= -# REMOVE NODEJS -#================================================= -ynh_script_progression --message="Removing NodeJS version for Etherpad..." --weight=3 - ynh_remove_nodejs -#================================================= -# REMOVE THE REDIS DATABASE -#================================================= -ynh_script_progression --message="Removing the redis database..." - ynh_redis_remove_db "$redis_db" -#================================================= -# REMOVE NGINX CONFIGURATION -#================================================= -ynh_script_progression --message="Removing NGINX web server configuration..." --weight=1 - # Remove the dedicated NGINX config ynh_remove_nginx_config -#================================================= -# SPECIFIC REMOVE -#================================================= -# REMOVE VARIOUS FILES -#================================================= -ynh_script_progression --message="Removing various files..." --weight=1 - # Remove the log files ynh_secure_remove --file="/var/log/$app" diff --git a/scripts/restore b/scripts/restore index d90e9fb..513c4a2 100644 --- a/scripts/restore +++ b/scripts/restore @@ -9,14 +9,6 @@ source ../settings/scripts/_common.sh source /usr/share/yunohost/helpers -#================================================= -# STANDARD RESTORATION STEPS -#================================================= -# RESTORE THE NGINX CONFIGURATION -#================================================= - -ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf" - #================================================= # RESTORE THE APP MAIN DIR #================================================= @@ -45,29 +37,10 @@ ynh_script_progression --message="Restoring the systemd configuration..." --weig ynh_restore_file --origin_path="/etc/systemd/system/$app.service" systemctl enable $app.service --quiet -#================================================= -# RESTORE THE LOGROTATE CONFIGURATION -#================================================= -ynh_script_progression --message="Restoring the logrotate configuration..." --weight=1 +ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf" ynh_restore_file --origin_path="/etc/logrotate.d/$app" -#================================================= -# INSTALL DEPENDENCIES -#================================================= -#REMOVEME? ynh_script_progression --message="Reinstalling dependencies..." --weight=10 - -if [ "$export" = "abiword" ]; then -#REMOVEME? ynh_exec_warn_less ynh_install_app_dependencies $abiword_app_depencencies -elif [ "$export" = "libreoffice" ]; then -#REMOVEME? ynh_exec_warn_less ynh_install_app_dependencies $libreoffice_app_dependencies -fi - -#================================================= -# INTEGRATE SERVICE IN YUNOHOST -#================================================= -ynh_script_progression --message="Integrating service in YunoHost..." --weight=3 - yunohost service add $app --description="Collaborative editor" --log="/var/log/$app/$app.log" #================================================= @@ -78,13 +51,6 @@ ynh_script_progression --message="Starting a systemd service..." --weight=8 ynh_systemd_action --service_name=$app --action=restart --log_path=systemd --line_match="Your Etherpad version is" sleep 60 -#================================================= -# GENERIC FINALIZATION -#================================================= -# RELOAD NGINX AND PHP-FPM -#================================================= -ynh_script_progression --message="Reloading NGINX web server..." --weight=2 - ynh_systemd_action --service_name=nginx --action=reload #=================================================