From 18916f692b636b67bd631113b46e2d82dd6cb143 Mon Sep 17 00:00:00 2001 From: Yalh Date: Sat, 19 Jan 2019 04:31:01 +0100 Subject: [PATCH] Fix installation --- scripts/install | 9 +++++---- scripts/remove | 25 +++++++++++++++++++++++++ 2 files changed, 30 insertions(+), 4 deletions(-) diff --git a/scripts/install b/scripts/install index 4369898..f4aac7f 100644 --- a/scripts/install +++ b/scripts/install @@ -103,8 +103,6 @@ fi # NGINX CONFIGURATION #================================================= -### `ynh_add_nginx_config` will use the file conf/nginx.conf - # Create a dedicated nginx config ynh_add_nginx_config @@ -112,8 +110,11 @@ ynh_add_nginx_config # CREATE DEDICATED USER #================================================= -# Create a system user -ynh_system_user_create $app +# Create a standard user (not a system user for sftp) +ynh_system_user_exists "$user" || \ + useradd -d "$final_path" -M --user-group "$user" +# Add the password to this user +chpasswd <<< "${user}:${password}" #================================================= # PHP-FPM CONFIGURATION diff --git a/scripts/remove b/scripts/remove index 05d2085..86affea 100644 --- a/scripts/remove +++ b/scripts/remove @@ -25,6 +25,31 @@ user=$(ynh_app_setting_get $app user) #================================================= # STANDARD REMOVE +#================================================= +# STOP AND REMOVE SERVICE +#================================================= + +# Remove the dedicated systemd config +ynh_remove_systemd_config + +#================================================= +# REMOVE SERVICE FROM ADMIN PANEL +#================================================= + +# Remove a service from the admin panel, added by `yunohost service add` +if yunohost service status | grep -q $app +then + echo "Remove $app service" + yunohost service remove $app +fi + +#================================================= +# REMOVE DEPENDENCIES +#================================================= + +# Remove metapackage and its dependencies +ynh_remove_app_dependencies + #================================================= # REMOVE THE MYSQL DATABASE #=================================================