advertise http for easy discovery

This commit is contained in:
frederik
2024-04-08 10:54:51 +02:00
parent 734f1d1374
commit b820c195ca
4 changed files with 23 additions and 0 deletions
+3
View File
@@ -233,6 +233,9 @@ WantedBy=multi-user.target
EOF
ln -sf $HOME/BirdNET-Pi/templates/avahi-alias@.service /usr/lib/systemd/system
systemctl enable avahi-alias@"$(hostname)".local.service
# symbolic link does not work here, so just copy
cp -f $HOME/BirdNET-Pi/templates/http.service /etc/avahi/services/
systemctl restart avahi-daemon.service
}
install_birdnet_stats_service() {
+5
View File
@@ -27,6 +27,11 @@ remove_services() {
set +x
remove_icecast
remove_crons
remove_avahi_services
}
remove_avahi_services() {
sudo rm -v "/etc/avahi/services/http.service"
}
remove_crons() {
+6
View File
@@ -154,6 +154,12 @@ if grep -q 'php7.4-' /etc/caddy/Caddyfile &>/dev/null; then
sed -i 's/php7.4-/php-/' /etc/caddy/Caddyfile
fi
if ! [ -L /etc/avahi/services/http.service ];then
# symbolic link does not work here, so just copy
cp -f $HOME/BirdNET-Pi/templates/http.service /etc/avahi/services/
systemctl restart avahi-daemon.service
fi
if [ -L /usr/local/bin/analyze.py ];then
rm -f /usr/local/bin/analyze.py
fi
+9
View File
@@ -0,0 +1,9 @@
<?xml version="1.0" standalone='no'?><!--*-nxml-*-->
<!DOCTYPE service-group SYSTEM "avahi-service.dtd">
<service-group>
<name replace-wildcards="yes">BirdNET-Pi %h</name>
<service>
<type>_http._tcp</type>
<port>80</port>
</service>
</service-group>