diff --git a/scripts/install b/scripts/install index a6a57d2..3d2fb91 100644 --- a/scripts/install +++ b/scripts/install @@ -57,6 +57,14 @@ ynh_script_progression --message="Installing dependencies..." --weight=2 ynh_install_app_dependencies $pkg_dependencies +#================================================= +# CREATE DEDICATED USER +#================================================= +ynh_script_progression --message="Configuring system user..." --weight=3 + +# Create a system user +ynh_system_user_create --username=$app + #================================================= # NGINX CONFIGURATION #================================================= @@ -66,14 +74,6 @@ path_no_root=${path_url%/} # Create a dedicated NGINX config ynh_add_nginx_config "path_no_root" -#================================================= -# CREATE DEDICATED USER -#================================================= -ynh_script_progression --message="Configuring system user..." --weight=3 - -# Create a system user -ynh_system_user_create --username=$app - #================================================= # DOWNLOAD, CHECK AND UNPACK SOURCE #================================================= diff --git a/scripts/restore b/scripts/restore index 7641b1d..8672a9b 100755 --- a/scripts/restore +++ b/scripts/restore @@ -47,6 +47,14 @@ test ! -d $final_path \ ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf" +#================================================= +# RECREATE OF THE DEDICATED USER +#================================================= +ynh_script_progression --message="Recreating the dedicated system user..." --weight=3 + +# Create the dedicated user (if not existing) +ynh_system_user_create --username=$app + #================================================= # RESTORE OF THE MAIN DIR OF THE APP #================================================= @@ -62,14 +70,6 @@ ynh_script_progression --message="Reinstalling dependencies..." --weight=35 ynh_install_app_dependencies $pkg_dependencies -#================================================= -# RECREATE OF THE DEDICATED USER -#================================================= -ynh_script_progression --message="Recreating the dedicated system user..." --weight=3 - -# Create the dedicated user (if not existing) -ynh_system_user_create --username=$app - #================================================= # SPECIFIC RESTORE #================================================= diff --git a/scripts/upgrade b/scripts/upgrade index f43378c..afcc96e 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -67,6 +67,14 @@ ynh_script_progression --message="Upgrading dependencies..." --weight=7 ynh_install_app_dependencies $pkg_dependencies +#================================================= +# CREATE DEDICATED USER +#================================================= +ynh_script_progression --message="Making sure dedicated system user exists..." --weight=1 + +# Create a dedicated user (if not existing) +ynh_system_user_create --username=$app + #================================================= # DOWNLOAD, CHECK AND UNPACK SOURCE #================================================= @@ -91,14 +99,6 @@ path_no_root=${path_url%/} # Create a dedicated NGINX config ynh_add_nginx_config "path_no_root" -#================================================= -# CREATE DEDICATED USER -#================================================= -ynh_script_progression --message="Making sure dedicated system user exists..." --weight=1 - -# Create a dedicated user (if not existing) -ynh_system_user_create --username=$app - #================================================= # SPECIFIC UPGRADE #=================================================