From 6216ae3211b7dc018204988f4ed4dcf8b260d69d Mon Sep 17 00:00:00 2001 From: yalh76 Date: Tue, 30 Aug 2022 20:27:27 +0200 Subject: [PATCH 1/2] Update ynh_handle_app_migration --- scripts/ynh_handle_app_migration | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/scripts/ynh_handle_app_migration b/scripts/ynh_handle_app_migration index 63f926c..409cdf6 100644 --- a/scripts/ynh_handle_app_migration +++ b/scripts/ynh_handle_app_migration @@ -198,8 +198,7 @@ ynh_handle_app_migration () { old_db_name=$(ynh_app_setting_get --app=$old_app --key=db_name) # Check if a database exists before trying to move it - local mysql_root_password=$(cat $MYSQL_ROOT_PWD_FILE) - if [ -n "$old_db_name" ] && mysqlshow -u root -p$mysql_root_password | grep -q "^| $old_db_name" + if [ -n "$old_db_name" ] && mysqlshow | grep -q "^| $old_db_name" then old_db_user=$old_db_name db_pwd=$(ynh_app_setting_get --app=$old_app --key=mysqlpwd) From fcaf0da5ed1cd35c9cc78fde29af97adef6dd291 Mon Sep 17 00:00:00 2001 From: yalh76 Date: Tue, 30 Aug 2022 20:31:43 +0200 Subject: [PATCH 2/2] Fix upgrade --- scripts/upgrade | 1 + 1 file changed, 1 insertion(+) diff --git a/scripts/upgrade b/scripts/upgrade index 4040911..ca274f2 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -119,6 +119,7 @@ if [ -z $datadir ]; then mkdir -p $datadir rsync -arz "$final_path/live/data/" "$datadir/" --delete-after --remove-source-files ynh_secure_remove --file="$final_path/live/data" + ynh_system_user_create --username=$app --home_dir="$final_path" chmod 750 "$datadir" chmod -R o-rwx "$datadir" chown -R $app:$app "$datadir"