1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/synapse_ynh.git synced 2024-09-03 20:26:38 +02:00
synapse_ynh/sources/Coturn_config_rotate.sh
2024-03-22 12:16:27 +01:00

34 lines
1.1 KiB
Bash

#!/bin/bash
set -eu
app=__APP__
YNH_APP_BASEDIR=/etc/yunohost/apps/"$app"
pushd /etc/yunohost/apps/$app/conf
source /usr/share/yunohost/helpers
# Must load db_name var to load _common.sh
db_name=$(ynh_app_setting_get --app=$app --key=db_name)
source ../scripts/_common.sh
domain=$(ynh_app_setting_get --app=$app --key=domain)
port_cli=$(ynh_app_setting_get --app=$app --key=port_cli)
turnserver_pwd=$(ynh_app_setting_get --app=$app --key=turnserver_pwd)
port_turnserver_tls=$(ynh_app_setting_get --app=$app --key=port_turnserver_tls)
port_turnserver_alt_tls=$(ynh_app_setting_get --app=$app --key=port_turnserver_alt_tls)
enable_dtls_for_audio_video_turn_call=$(ynh_app_setting_get --app=$app --key=enable_dtls_for_audio_video_turn_call)
previous_checksum=$(ynh_app_setting_get --app=$app --key=checksum__etc_matrix-synapse_coturn.conf)
configure_coturn
new_checksum=$(ynh_app_setting_get --app=$app --key=checksum__etc_matrix-synapse_coturn.conf)
setfacl -R -m user:turnserver:rX /etc/matrix-$app
if [ "$previous_checksum" != "$new_checksum" ]
then
systemctl restart $app-coturn.service
fi
exit 0