From ff01ce573d9778b8af084c8f967c49beb9d35043 Mon Sep 17 00:00:00 2001 From: Gredin67 <35761345+Gredin67@users.noreply.github.com> Date: Thu, 29 Oct 2020 17:35:59 +0100 Subject: [PATCH] Testing (#19) * use app action set_admin_user * get install working by waiting for theuser to be created before calling the app action --- scripts/install | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/scripts/install b/scripts/install index 6947e59..ffb1e8e 100755 --- a/scripts/install +++ b/scripts/install @@ -391,11 +391,13 @@ ynh_script_progression --message="Starting a systemd service..." --time --weight # Start a systemd service ynh_systemd_action --service_name=$app --action="start" +# 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_is_synapse_admin" = "Yes" ] then - ynh_psql_execute_as_root --database=$synapse_db_name --sql="UPDATE users SET admin = 1 WHERE name = '@$whatsappbot:$server_name';" -# yunohost app action run $synapse_instance set_admin_user -a username=$whatsappbot +# ynh_psql_execute_as_root --database=$synapse_db_name --sql="UPDATE users SET admin = 1 WHERE name = '@$whatsappbot:$server_name';" + yunohost app action run $synapse_instance set_admin_user -a username=$whatsappbot fi ynh_systemd_action --service_name=$app --action="restart"