Add avahi service for matrix

This commit is contained in:
Bob Mottram 2018-01-30 11:32:11 +00:00
parent 9f78c7df9f
commit 23fc305fb2
1 changed files with 20 additions and 0 deletions

View File

@ -597,6 +597,9 @@ function remove_matrix {
remove_completion_param install_matrix
sed -i '/matrix/d' $COMPLETION_FILE
rm /etc/avahi/services/matrix.service
systemctl restart avahi-daemon
}
function install_home_server {
@ -802,5 +805,22 @@ function install_matrix {
set_completion_param "matrix domain" "$MATRIX_DOMAIN_NAME"
# Add avahi services
echo '<?xml version="1.0" standalone="no"?><!--*-nxml-*-->' > /etc/avahi/services/matrix.service
echo '<!DOCTYPE service-group SYSTEM "avahi-service.dtd">' >> /etc/avahi/services/matrix.service
echo '<service-group>' >> /etc/avahi/services/matrix.service
echo ' <name replace-wildcards="yes">%h MATRIX</name>' >> /etc/avahi/services/matrix.service
echo ' <service>' >> /etc/avahi/services/matrix.service
echo ' <type>_matrix._tcp</type>' >> /etc/avahi/services/matrix.service
echo " <port>$MATRIX_HTTP_PORT</port>" >> /etc/avahi/services/matrix.service
echo ' </service>' >> /etc/avahi/services/matrix.service
echo ' <service>' >> /etc/avahi/services/matrix.service
echo ' <type>_matrix._udp</type>' >> /etc/avahi/services/matrix.service
echo " <port>$MATRIX_HTTP_PORT</port>" >> /etc/avahi/services/matrix.service
echo ' </service>' >> /etc/avahi/services/matrix.service
echo '</service-group>' >> /etc/avahi/services/matrix.service
systemctl restart avahi-daemon
APP_INSTALLED=1
}