Files
AvianVisitors/scripts/restart_services.sh
T
2022-01-25 08:32:59 -05:00

16 lines
539 B
Bash
Executable File

#!/usr/bin/env bash
# Restarts ALL services and removes ALL unprocessed audio
source /etc/birdnet/birdnet.conf
my_dir=/home/pi/BirdNET-Pi/scripts
sudo systemctl stop birdnet_recording.service
sudo rm -rf ${RECS_DIR}/$(date +%B-%Y/%d-%A)/*
sudo systemctl start birdnet_recording.service
services=($(awk '/systemctl/ && !/php/ && !/caddy/ && !/target/ {print $3}' <(sed -e 's/--now//g' ${my_dir}/update_services.sh) | sort | uniq ))
for i in "${services[@]}";do
sudo systemctl restart "${i}"
done
sudo systemctl restart extraction.timer