A live bird collage card for your Home Assistant dashboard.
Adjusting systemd unit files to avoid hardcoded UID in the runtime dir path (#461)
cjwaian29eb69025ae4
diff --git a/scripts/install_services.sh b/scripts/install_services.shindex 93a3366c..458c568d 100755--- a/scripts/install_services.sh+++ b/scripts/install_services.sh@@ -119,7 +119,6 @@ install_recording_service() {[Unit]Description=BirdNET Recording[Service]-Environment=XDG_RUNTIME_DIR=/run/user/1000Restart=alwaysType=simpleRestartSec=3@@ -138,7 +137,6 @@ install_custom_recording_service() {[Unit]Description=BirdNET Custom Recording[Service]-Environment=XDG_RUNTIME_DIR=/run/user/1000Restart=alwaysType=simpleRestartSec=3@@ -365,7 +363,6 @@ Description=BirdNET-Pi Live StreamAfter=network-online.targetRequires=network-online.target[Service]-Environment=XDG_RUNTIME_DIR=/run/user/1000Restart=alwaysType=simpleRestartSec=3diff --git a/scripts/update_birdnet_snippets.sh b/scripts/update_birdnet_snippets.shindex 4ac57601..937b8881 100755--- a/scripts/update_birdnet_snippets.sh+++ b/scripts/update_birdnet_snippets.sh@@ -173,7 +173,7 @@ if ! grep 'daemon' $HOME/BirdNET-Pi/templates/chart_viewer.service &>/dev/null;tsystemctl daemon-reload && restart_services.shfi-if grep -q 'birdnet_server.service' "$HOME/BirdNET-Pi/templates/birdnet_analysis.service"&>/dev/null; then+if grep -q 'birdnet_server.service' "$HOME/BirdNET-Pi/templates/birdnet_analysis.service" &>/dev/null; thensed -i '/After=.*/d' "$HOME/BirdNET-Pi/templates/birdnet_analysis.service"sed -i '/Requires=.*/d' "$HOME/BirdNET-Pi/templates/birdnet_analysis.service"sed -i '/RuntimeMaxSec=.*/d' "$HOME/BirdNET-Pi/templates/birdnet_analysis.service"@@ -187,20 +187,39 @@ if ! [ -f "$HOME/BirdNET-Pi/templates/$TMP_MOUNT" ]; thenchown $USER:$USER "$HOME/BirdNET-Pi/templates/$TMP_MOUNT"fi-if grep -q -e '-P log' $HOME/BirdNET-Pi/templates/birdnet_log.service ;then+if grep -q -e '-P log' $HOME/BirdNET-Pi/templates/birdnet_log.service ; thensed -i "s/-P log/--path log/" ~/BirdNET-Pi/templates/birdnet_log.servicesystemctl daemon-reload && restart_services.shfi-if grep -q -e '-P terminal' $HOME/BirdNET-Pi/templates/web_terminal.service ;then+if grep -q -e '-P terminal' $HOME/BirdNET-Pi/templates/web_terminal.service ; thensed -i "s/-P terminal/--path terminal/" ~/BirdNET-Pi/templates/web_terminal.servicesystemctl daemon-reload && restart_services.shfi+if grep -q -e 'Environment=XDG_RUNTIME_DIR=/run/user/' $HOME/BirdNET-Pi/templates/birdnet_recording.service; then+ sed -i '/^Environment=XDG_RUNTIME_DIR=\/run\/user\/[0-9]\+/d' $HOME/BirdNET-Pi/templates/birdnet_recording.service+ systemctl daemon-reload && restart_services.sh+fi++if grep -q -e 'Environment=XDG_RUNTIME_DIR=/run/user/' $HOME/BirdNET-Pi/templates/custom_recording.service; then+ sed -i '/^Environment=XDG_RUNTIME_DIR=\/run\/user\/[0-9]\+/d' $HOME/BirdNET-Pi/templates/custom_recording.service+ systemctl daemon-reload && restart_services.sh+fi++if grep -q -e 'Environment=XDG_RUNTIME_DIR=/run/user/' $HOME/BirdNET-Pi/templates/livestream.service; then+ sed -i '/^Environment=XDG_RUNTIME_DIR=\/run\/user\/[0-9]\+/d' $HOME/BirdNET-Pi/templates/livestream.service+ systemctl daemon-reload && restart_services.sh+fi+if grep -q 'php7.4-' /etc/caddy/Caddyfile &>/dev/null; thensed -i 's/php7.4-/php-/' /etc/caddy/Caddyfilefi+if grep -q '^HIDE_MOUNTS.*\/run\/user' $HOME/BirdNET-Pi/templates/phpsysinfo.ini; then+ sed -i 's#/run/user/[0-9]\+#/run/user/[0-9]+#g' $HOME/BirdNET-Pi/templates/phpsysinfo.ini+fi+if ! [ -L /etc/avahi/services/http.service ];then# symbolic link does not work here, so just copycp -f $HOME/BirdNET-Pi/templates/http.service /etc/avahi/services/