From 2a8da1c055a7a8fb695a2615436a06684424967b Mon Sep 17 00:00:00 2001 From: yalh76 Date: Tue, 24 May 2022 01:06:35 +0200 Subject: [PATCH] CREATE DEDICATED USER --- scripts/install | 8 ++++++++ scripts/restore | 8 ++++++++ scripts/upgrade | 8 ++++++++ 3 files changed, 24 insertions(+) diff --git a/scripts/install b/scripts/install index 429d3d8..cf2861e 100644 --- a/scripts/install +++ b/scripts/install @@ -77,6 +77,14 @@ ynh_script_progression --message="Installing dependencies..." ynh_install_app_dependencies $pkg_dependencies +#================================================= +# CREATE DEDICATED USER +#================================================= +ynh_script_progression --message="Configuring system user..." + +# Create a system user +ynh_system_user_create --username=$app --home_dir="$final_path" + #================================================= # DOWNLOAD, CHECK AND UNPACK SOURCE #================================================= diff --git a/scripts/restore b/scripts/restore index 2093ee0..57a42f8 100644 --- a/scripts/restore +++ b/scripts/restore @@ -53,6 +53,14 @@ ynh_script_progression --message="Restoring the NGINX web server configuration.. ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf" +#================================================= +# RECREATE THE DEDICATED USER +#================================================= +ynh_script_progression --message="Recreating the dedicated system user..." + +# Create the dedicated user (if not existing) +ynh_system_user_create --username=$app --home_dir="$final_path" + #================================================= # SPECIFIC RESTORATION #================================================= diff --git a/scripts/upgrade b/scripts/upgrade index c29780a..ef79f2e 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -94,6 +94,14 @@ ynh_secure_remove --file="/var/log/$app" # No more needed since systemd ynh_delete_file_checksum --file="/etc/default/jenkins" +#================================================= +# CREATE DEDICATED USER +#================================================= +ynh_script_progression --message="Making sure dedicated system user exists..." + +# Create a dedicated user (if not existing) +ynh_system_user_create --username=$app --home_dir="$final_path" + #================================================= # DOWNLOAD, CHECK AND UNPACK SOURCE #=================================================