avahi services
This commit is contained in:
parent
9450b24fcc
commit
482a120a19
|
@ -1658,11 +1658,37 @@ function configure_avahi {
|
|||
sed -i "s|#host-name=.*|host-name=mesh-$PEER_ID|g" /etc/avahi/avahi-daemon.conf
|
||||
fi
|
||||
|
||||
if [ ! -d /etc/avahi/services ]; then
|
||||
mkdir -p /etc/avahi/services
|
||||
fi
|
||||
|
||||
# remove an avahi service which isn't used
|
||||
if [ -f /etc/avahi/services/udisks.service ]; then
|
||||
rm /etc/avahi/services/udisks.service
|
||||
fi
|
||||
|
||||
# Add an ssh service
|
||||
echo '<?xml version="1.0" standalone="no"?><!--*-nxml-*-->' > /etc/avahi/services/ssh.service
|
||||
echo '<!DOCTYPE service-group SYSTEM "avahi-service.dtd">' >> /etc/avahi/services/ssh.service
|
||||
echo '<service-group>' >> /etc/avahi/services/ssh.service
|
||||
echo '<name replace-wildcards="yes">%h SSH</name>' >> /etc/avahi/services/ssh.service
|
||||
echo '<service>' >> /etc/avahi/services/ssh.service
|
||||
echo '<type>_ssh._tcp</type>' >> /etc/avahi/services/ssh.service
|
||||
echo "<port>$SSH_PORT</port>" >> /etc/avahi/services/ssh.service
|
||||
echo '</service>' >> /etc/avahi/services/ssh.service
|
||||
echo '</service-group>' >> /etc/avahi/services/ssh.service
|
||||
|
||||
# Add an irc service
|
||||
echo '<?xml version="1.0" standalone="no"?><!--*-nxml-*-->' > /etc/avahi/services/irc.service
|
||||
echo '<!DOCTYPE service-group SYSTEM "avahi-service.dtd">' >> /etc/avahi/services/irc.service
|
||||
echo '<service-group>' >> /etc/avahi/services/irc.service
|
||||
echo '<name replace-wildcards="yes">%h IRC</name>' >> /etc/avahi/services/irc.service
|
||||
echo '<service>' >> /etc/avahi/services/irc.service
|
||||
echo '<type>_irc._tcp</type>' >> /etc/avahi/services/irc.service
|
||||
echo "<port>6697</port>" >> /etc/avahi/services/irc.service
|
||||
echo '</service>' >> /etc/avahi/services/irc.service
|
||||
echo '</service-group>' >> /etc/avahi/services/irc.service
|
||||
|
||||
systemctl restart avahi-daemon
|
||||
echo 'configure_avahi' >> $COMPLETION_FILE
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue