diff --git a/scripts/install b/scripts/install index c17473d..9c706b7 100644 --- a/scripts/install +++ b/scripts/install @@ -72,6 +72,14 @@ ynh_app_setting_set --app=$app --key=port --value=$port ynh_app_setting_set --app=$app --key=port_hub --value=$port_hub ynh_app_setting_set --app=$app --key=port_http_proxy --value=$port_http_proxy +#================================================= +# CREATE DEDICATED USER +#================================================= +ynh_script_progression --message="Configuring system user..." --weight=1 + +# Create a system user +ynh_system_user_create --username=$app + #================================================= # INSTALL DEPENDENCIES #================================================= @@ -104,14 +112,6 @@ ynh_script_progression --message="Configuring NGINX web server..." --weight=1 # Create a dedicated nginx config ynh_add_nginx_config -#================================================= -# CREATE DEDICATED USER -#================================================= -ynh_script_progression --message="Configuring system user..." --weight=1 - -# Create a system user -ynh_system_user_create --username=$app - #================================================= # SPECIFIC SETUP #================================================= diff --git a/scripts/restore b/scripts/restore index 4e7359f..9fd4b89 100644 --- a/scripts/restore +++ b/scripts/restore @@ -50,13 +50,6 @@ test ! -d $final_path \ ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf" -#================================================= -# RESTORE THE APP MAIN DIR -#================================================= -ynh_script_progression --message="Restoring the app main directory..." --weight=5 - -ynh_restore_file --origin_path="$final_path" - #================================================= # RECREATE THE DEDICATED USER #================================================= @@ -65,6 +58,13 @@ ynh_script_progression --message="Recreating the dedicated system user..." --wei # Create the dedicated user (if not existing) ynh_system_user_create --username=$app +#================================================= +# RESTORE THE APP MAIN DIR +#================================================= +ynh_script_progression --message="Restoring the app main directory..." --weight=5 + +ynh_restore_file --origin_path="$final_path" + #================================================= # RESTORE USER RIGHTS #=================================================