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

36 lines
1.2 KiB
Bash
Raw Normal View History

#!/bin/bash
2024-02-20 21:39:06 +01:00
set -eu
2024-02-20 23:49:31 +01:00
app=__APP__
2024-03-21 23:34:04 +01:00
YNH_APP_BASEDIR=/etc/yunohost/apps/"$app"
2024-02-20 23:49:31 +01:00
pushd /etc/yunohost/apps/$app/conf
2024-03-12 20:30:35 +01:00
source /usr/share/yunohost/helpers
2024-03-12 20:30:35 +01:00
# Must load db_name var to load _common.sh
db_name=$(ynh_app_setting_get --app=$app --key=db_name)
2024-03-12 20:30:35 +01:00
source ../scripts/_common.sh
2024-02-20 23:49:31 +01:00
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)
2024-06-24 22:43:08 +02:00
turnserver_cli_pwd=$(ynh_app_setting_get --app=$app --key=turnserver_cli_pwd)
2024-02-20 23:49:31 +01:00
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)
2024-03-21 23:34:04 +01:00
enable_dtls_for_audio_video_turn_call=$(ynh_app_setting_get --app=$app --key=enable_dtls_for_audio_video_turn_call)
2024-02-20 23:49:31 +01:00
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)
2021-02-18 09:16:37 +01:00
2024-02-20 23:49:31 +01:00
setfacl -R -m user:turnserver:rX /etc/matrix-$app
2024-02-20 23:49:31 +01:00
if [ "$previous_checksum" != "$new_checksum" ]
then
2024-02-20 23:49:31 +01:00
systemctl restart $app-coturn.service
fi
exit 0