From 5232d2c1362b3491ebac55ab3374c9535418c6e9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?E=CC=81ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Sat, 25 Mar 2023 21:12:54 +0100 Subject: [PATCH] fix --- scripts/install | 22 +++++----------------- scripts/remove | 10 ---------- scripts/restore | 17 ----------------- scripts/upgrade | 19 +------------------ 4 files changed, 6 insertions(+), 62 deletions(-) diff --git a/scripts/install b/scripts/install index de5d0c3..ad611e0 100755 --- a/scripts/install +++ b/scripts/install @@ -28,6 +28,11 @@ ynh_script_progression --message="Configuring NGINX web server..." --weight=1 # Create a dedicated NGINX config ynh_add_nginx_config +# Create a dedicated systemd config +ynh_add_systemd_config + +yunohost service add $app --description="$app service" + #================================================= # SPECIFIC SETUP #================================================= @@ -40,23 +45,6 @@ ynh_add_config --template="../conf/beehive.conf" --destination="$install_dir/bee chmod 600 "$install_dir/beehive.conf" chown $app:$app "$install_dir/beehive.conf" -#================================================= -# SETUP SYSTEMD -#================================================= -ynh_script_progression --message="Configuring a systemd service..." --weight=1 - -# Create a dedicated systemd config -ynh_add_systemd_config - -#================================================= -# GENERIC FINALIZATION -#================================================= -# INTEGRATE SERVICE IN YUNOHOST -#================================================= -ynh_script_progression --message="Integrating service in YunoHost..." --weight=1 - -yunohost service add $app --description="$app service" - #================================================= # START SYSTEMD SERVICE #================================================= diff --git a/scripts/remove b/scripts/remove index 06fb827..57324bf 100755 --- a/scripts/remove +++ b/scripts/remove @@ -22,19 +22,9 @@ 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 NGINX CONFIGURATION -#================================================= -ynh_script_progression --message="Removing NGINX web server configuration..." --weight=1 - # Remove the dedicated NGINX config ynh_remove_nginx_config diff --git a/scripts/restore b/scripts/restore index efdfbe6..04009fe 100755 --- a/scripts/restore +++ b/scripts/restore @@ -32,19 +32,9 @@ ynh_script_progression --message="Restoring the NGINX web server configuration.. ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf" -#================================================= -# RESTORE SYSTEMD -#================================================= -ynh_script_progression --message="Restoring the systemd configuration..." --weight=1 - 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="$app service" #================================================= @@ -54,13 +44,6 @@ ynh_script_progression --message="Starting a systemd service..." --weight=1 ynh_systemd_action --service_name=$app --action="start" --log_path=systemd --line_match="Config file loaded from" -#================================================= -# GENERIC FINALIZATION -#================================================= -# RELOAD NGINX AND PHP-FPM -#================================================= -ynh_script_progression --message="Reloading NGINX web server" --weight=1 - ynh_systemd_action --service_name=nginx --action=reload #================================================= diff --git a/scripts/upgrade b/scripts/upgrade index a5d87eb..30598db 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -33,7 +33,7 @@ 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="beehive.conf" + ynh_setup_source --dest_dir="$install_dir" --keep="beehive.conf" fi chmod -R o-rwx "$install_dir" @@ -47,29 +47,12 @@ ynh_script_progression --message="Upgrading NGINX web server configuration..." - # Create a dedicated NGINX config ynh_add_nginx_config -#================================================= -# SETUP SYSTEMD -#================================================= -ynh_script_progression --message="Upgrading systemd configuration..." --weight=1 - # Create a dedicated systemd config ynh_add_systemd_config -#================================================= -# GENERIC FINALIZATION -#================================================= -# SETUP LOGROTATE -#================================================= -ynh_script_progression --message="Upgrading logrotate configuration..." --weight=1 - # Use logrotate to manage app-specific logfile(s) ynh_use_logrotate --non-append -#================================================= -# INTEGRATE SERVICE IN YUNOHOST -#================================================= -ynh_script_progression --message="Integrating service in YunoHost..." --weight=1 - yunohost service add $app --description="$app service" #=================================================