1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/synapse-admin_ynh.git synced 2024-09-03 20:26:34 +02:00
synapse-admin_ynh/scripts/_common.sh

25 lines
912 B
Bash
Raw Normal View History

2021-05-10 15:15:42 +02:00
#!/bin/bash
synapse_domain=$(ynh_app_setting_get --app="$synapse_app" --key=domain)
synapse_port=$(ynh_app_setting_get --app="$synapse_app" --key=port_synapse)
if [[ -z "$synapse_port" ]]
then
# The setting was synapse_port in older versions of the app
2024-01-08 12:11:02 +01:00
synapse_port=$(ynh_app_setting_get --app="$synapse_app" --key=synapse_port)
if [[ -z "$synapse_port" ]]
ynh_die --message="Unable to find synapse port ?!"
2024-01-08 12:11:02 +01:00
fi
fi
_add_synapse_endpoint_nginx_config() {
# In case the domain changed for some reason
old_endpoint_confs_for_this_app="$(ls /etc/nginx/conf.d/!($synapse_domain).d/$app.endpoint.conf)"
for FILE in $old_endpoint_confs_for_this_app
do
ynh_delete_file_checksum --file="$FILE"
ynh_secure_remove --file="$FILE"
done
2024-01-08 12:11:02 +01:00
ynh_add_config --template="endpoint.nginx.conf" --destination="/etc/nginx/conf.d/${synapse_domain}.d/$app.endpoint.conf"
}