1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/mautrix_whatsapp_ynh.git synced 2024-09-03 19:46:01 +02:00
* use app action set_admin_user

* get install working by waiting for theuser to be created before calling the app action
This commit is contained in:
Gredin67 2020-10-29 17:35:59 +01:00 committed by GitHub
parent 18f5ccb1ad
commit ff01ce573d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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"