From 2171a7fc09a711f72a60e6194c11018665b6e694 Mon Sep 17 00:00:00 2001 From: Mayeul Cantan Date: Sat, 27 Apr 2024 15:58:30 +0200 Subject: [PATCH] Fix setting the bot admin in restore --- scripts/restore | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/restore b/scripts/restore index 94755cf..1af86d3 100755 --- a/scripts/restore +++ b/scripts/restore @@ -74,8 +74,8 @@ ynh_systemd_action --service_name="$app" --action="start" --log_path="/var/log/$ # Wait until the synapse user is created sleep 30 # (Note that, by default, non-admins might not have your homeserver's permission to create communities.) -if [ "$bot_synapse_adm" = true ]; then - ynh_psql_execute_as_root --database="$synapse_db_name" --sql="UPDATE users SET admin = 1 WHERE name = \"$botname\";" +if [ "$bot_synapse_adm" = true ] || [ "$bot_synapse_adm" = "1" ]; then + ynh_psql_execute_as_root --database="$synapse_db_name" --sql="UPDATE users SET admin = 1 WHERE name LIKE '@$botname:';" # #yunohost app action run $synapse_instance set_admin_user -a username=$botname fi