advertise http for easy discovery
This commit is contained in:
@@ -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() {
|
||||
|
||||
@@ -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() {
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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>
|
||||
Reference in New Issue
Block a user