diff --git a/scripts/upgrade b/scripts/upgrade index 0dfd7d8..add4c32 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -306,7 +306,7 @@ fi #================================================= if ynh_psql_execute_as_root --sql='\list' | grep matrix_$app; then - ynh_psql_remove_db --db_user="user_wich_must_dont_exist_and_keep_current_user" --db_name=$db_name + ynh_''psql_remove_db --db_user="user_wich_must_dont_exist_and_keep_current_user" --db_name=$db_name ynh_psql_execute_as_root --sql="ALTER DATABASE matrix_$app RENAME TO $db_name;" ynh_psql_execute_as_root --database=$db_name --sql="REASSIGN OWNED BY matrix_$app TO $db_user;" ynh_psql_execute_as_root --sql="UPDATE pg_database SET datcollate='C', datctype='C' WHERE datname='$db_name';" @@ -345,9 +345,9 @@ if grep -q "^matrix-$app" /etc/passwd; then # Must stop php before remove user as user is used by php systemctl stop php$YNH_PHP_VERSION-fpm.service - ynh_system_user_delete --username=matrix-$app + ynh_''system_user_delete --username=matrix-$app yunohost user delete $app || true - ynh_system_user_create --username=$app --home_dir=$code_dir + ynh_''system_user_create --username=$app --home_dir=$code_dir adduser $app ssl-cert fi