diff --git a/scripts/upgrade b/scripts/upgrade index ad6610f..e1372e0 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" 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)