Skip to content

A live bird collage card for your Home Assistant dashboard.

I think this is a better way to restart services

mcguirepr89bcf0ea040c07
diff --git a/scripts/restart_services.sh b/scripts/restart_services.sh
index 06c6c9fd..27771724 100755
--- a/scripts/restart_services.sh
+++ b/scripts/restart_services.sh
@@ -1,15 +1,25 @@
#!/usr/bin/env bash
# Restarts ALL services and removes ALL unprocessed audio
source /etc/birdnet/birdnet.conf
+set -x
my_dir=/home/pi/BirdNET-Pi/scripts
sudo systemctl stop birdnet_recording.service
sudo rm -rf ${RECS_DIR}/$(date +%B-%Y/%d-%A)/*
-services=($(awk '/systemctl/ && !/php/ && !/caddy/ && !/target/ && !/avahi/ {print $3}' <(sed -e 's/--now//g' ${my_dir}/update_services.sh) | sort | uniq ))
+services=(web_terminal.service
+spectrogram_viewer.service
+pushed_notifications.service
+livestream.service
+icecast2.service
+extraction.timer
+extraction.service
+chart_viewer.service
+birdnet_recording.service
+birdnet_log.service
+birdnet_server.service
+birdnet_analysis.service)
+sudo pkill server.py
for i in "${services[@]}";do
sudo systemctl restart "${i}"
done
-sudo systemctl restart extraction.timer
-sudo systemctl start birdnet_recording.service
-