From 0f9f95802acd75a4801259111cadae96ae8a2b6e Mon Sep 17 00:00:00 2001 From: rodinux Date: Sun, 15 Jan 2023 21:55:28 +0100 Subject: [PATCH] try fix migration --- scripts/upgrade | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/scripts/upgrade b/scripts/upgrade index b0368db..f280f07 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -76,9 +76,16 @@ fi ynh_handle_app_migration --migration_id=garradin --migration_list=garradin_migrations if [[ $migration_process -eq 1 ]]; then + final_path="/var/www/$app" + # Replace the user - ynh_system_user_delete --username="$old_app" --home_dir="$final_path" + ynh_system_user_delete $old_app ynh_system_user_create --username=$app --home_dir="$final_path" + + # Ensuring the user has the right home dir + if [ ~$app != "$final_path" ]; then + usermod -d "$final_path" $app + fi fi #=================================================