diff --git a/scripts/install_services.sh b/scripts/install_services.sh index dd3f802..9fe1d4e 100755 --- a/scripts/install_services.sh +++ b/scripts/install_services.sh @@ -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() { diff --git a/scripts/uninstall.sh b/scripts/uninstall.sh index e2c105d..fb63a41 100755 --- a/scripts/uninstall.sh +++ b/scripts/uninstall.sh @@ -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() { diff --git a/scripts/update_birdnet_snippets.sh b/scripts/update_birdnet_snippets.sh index 2c99612..5157a95 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; 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 diff --git a/templates/http.service b/templates/http.service new file mode 100644 index 0000000..fffd21d --- /dev/null +++ b/templates/http.service @@ -0,0 +1,9 @@ + + + +BirdNET-Pi %h + +_http._tcp +80 + +