A live bird collage card for your Home Assistant dashboard.
advertise http for easy discovery
frederikb820c195ca4c
diff --git a/scripts/install_services.sh b/scripts/install_services.shindex dd3f802d..9fe1d4e6 100755--- a/scripts/install_services.sh+++ b/scripts/install_services.sh@@ -233,6 +233,9 @@ WantedBy=multi-user.targetEOFln -sf $HOME/BirdNET-Pi/templates/[email protected] /usr/lib/systemd/systemsystemctl 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() {diff --git a/scripts/uninstall.sh b/scripts/uninstall.shindex e2c105d1..fb63a41b 100755--- a/scripts/uninstall.sh+++ b/scripts/uninstall.sh@@ -27,6 +27,11 @@ remove_services() {set +xremove_icecastremove_crons+ remove_avahi_services+}++remove_avahi_services() {+ sudo rm -v "/etc/avahi/services/http.service"}remove_crons() {diff --git a/scripts/update_birdnet_snippets.sh b/scripts/update_birdnet_snippets.shindex 2c99612a..5157a952 100755--- a/scripts/update_birdnet_snippets.sh+++ b/scripts/update_birdnet_snippets.sh@@ -154,6 +154,12 @@ if grep -q 'php7.4-' /etc/caddy/Caddyfile &>/dev/null; thensed -i 's/php7.4-/php-/' /etc/caddy/Caddyfilefi+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 ];thenrm -f /usr/local/bin/analyze.pyfidiff --git a/templates/http.service b/templates/http.servicenew file mode 100644index 00000000..fffd21d3--- /dev/null+++ b/templates/http.service@@ -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>