From c48b47104a5b6ce85fe2042b5e70279b83d4f962 Mon Sep 17 00:00:00 2001 From: tituspijean Date: Sun, 30 Jul 2023 21:09:42 +0200 Subject: [PATCH] Appease linter --- manifest.toml | 1 - scripts/install | 2 +- scripts/remove | 14 +++++++++++--- scripts/restore | 13 +++++++++---- scripts/upgrade | 4 ++-- 5 files changed, 23 insertions(+), 11 deletions(-) diff --git a/manifest.toml b/manifest.toml index 06eb0e9..5ee3bad 100644 --- a/manifest.toml +++ b/manifest.toml @@ -41,7 +41,6 @@ ram.runtime = "50M" ask.en = "Choose an author" ask.fr = "Choisissez l'auteur" type = "user" - default = "John Doe" [install.title] ask.en = "Choose a default title for your website" diff --git a/scripts/install b/scripts/install index 722c9e3..ba24a72 100644 --- a/scripts/install +++ b/scripts/install @@ -64,7 +64,7 @@ ynh_add_nginx_config # Create a dedicated systemd config ynh_add_systemd_config -yunohost service add $app --description="$app monitor, to automatically rebuild your website" --log="/var/log/$app/$app.log" +yunohost service add $app --description="$app monitor, to automatically rebuild your website" #================================================= # GENERIC FINALIZATION diff --git a/scripts/remove b/scripts/remove index bb21364..158d621 100644 --- a/scripts/remove +++ b/scripts/remove @@ -10,11 +10,19 @@ source _common.sh source /usr/share/yunohost/helpers #================================================= -# REMOVE NGINX CONFIGURATION +# REMOVE SYSTEM CONFIGURATIONS #================================================= -ynh_script_progression --message="Removing NGINX web server configuration..." +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 + yunohost service remove $app +fi + +ynh_remove_systemd_config -# Remove the dedicated NGINX config ynh_remove_nginx_config #================================================= diff --git a/scripts/restore b/scripts/restore index 8fae958..1b78b0a 100644 --- a/scripts/restore +++ b/scripts/restore @@ -13,12 +13,16 @@ source /usr/share/yunohost/helpers #================================================= # STANDARD RESTORATION STEPS #================================================= -# RESTORE THE NGINX CONFIGURATION +# RESTORE THE SYSTEM CONFIGURATIONS #================================================= -ynh_script_progression --message="Restoring the NGINX web server configuration..." +ynh_script_progression --message="Restoring system configurations related to $app..." --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 +yunohost service add $app --description="$app monitor, to automatically rebuild your website" + #================================================= # RESTORE THE APP MAIN DIR #================================================= @@ -32,11 +36,12 @@ chown -R $app:www-data "$install_dir" #================================================= # GENERIC FINALIZATION #================================================= -# RELOAD NGINX +# RELOAD SERVICES #================================================= -ynh_script_progression --message="Reloading NGINX web server..." +ynh_script_progression --message="Reloading services.." ynh_systemd_action --service_name=nginx --action=reload +ynh_systemd_action --service_name=$app --action="start" #================================================= # END OF SCRIPT diff --git a/scripts/upgrade b/scripts/upgrade index 82c1122..94a8501 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -83,7 +83,7 @@ ynh_add_nginx_config # Create a dedicated systemd config ynh_add_systemd_config -yunohost service add $app --description="$app monitor, to automatically rebuild your website" --log="/var/log/$app/$app.log" +yunohost service add $app --description="$app monitor, to automatically rebuild your website" #================================================= # GENERIC FINALIZATION @@ -93,7 +93,7 @@ yunohost service add $app --description="$app monitor, to automatically rebuild ynh_script_progression --message="Starting a systemd service..." --weight=1 # Start a systemd service -ynh_systemd_action --service_name=$app --action="start" --log_path="/var/log/$app/$app.log" +ynh_systemd_action --service_name=$app --action="start" #================================================= # END OF SCRIPT