diff --git a/scripts/upgrade b/scripts/upgrade index e78c188..e48f9d8 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -380,7 +380,14 @@ ynh_add_config --template="../sources/update_synapse_for_appservice.sh" --destin # Ensure app-service folder has exists and the config file exit (Migration) mkdir -p /etc/matrix-$app/app-service -test -e /etc/matrix-$app/conf.d/app_service.yaml || touch /etc/matrix-$app/conf.d/app_service.yaml +if [ -e /etc/matrix-$app/conf.d/app_service.yaml ]; then + # ensure that the file is empty if no app service are installed (fix issue #385) + if [ ! "$(ls -A /etc/matrix-$app/app-service)" ]; then + echo "" > /etc/matrix-$app/conf.d/app_service.yaml + fi +else + touch /etc/matrix-$app/conf.d/app_service.yaml +fi #================================================= # ADVERTISE SERVICE IN ADMIN PANEL diff --git a/sources/update_synapse_for_appservice.sh b/sources/update_synapse_for_appservice.sh index fda5ddb..072c3dd 100644 --- a/sources/update_synapse_for_appservice.sh +++ b/sources/update_synapse_for_appservice.sh @@ -8,6 +8,8 @@ cp $service_config_file /tmp/app_service_backup.yaml if [ -n "$(ls /etc/matrix-$app/app-service/)" ]; then echo "app_service_config_files:" > $service_config_file +else + echo "" > $service_config_file fi for f in $(ls /etc/matrix-$app/app-service/); do echo " - /etc/matrix-$app/app-service/$f" >> $service_config_file