adding condition to the birdnet_recording restart

This commit is contained in:
mcguirepr89
2022-05-21 14:01:48 -04:00
parent 2ec000be4e
commit 6a404ebb70
+4 -2
View File
@@ -20,12 +20,14 @@ make_thisrun() {
make_thisrun &> /dev/null
if ! diff ${LAST_RUN} ${THIS_RUN};then
echo "The birdnet.conf file has changed"
echo "Reloading services"
cat ${THIS_RUN} > ${LAST_RUN}
if grep REC <(diff $LAST_RUN $THIS_RUN);then
echo "Recording element changed -- restarting 'birdnet_recording.service'"
sudo systemctl stop birdnet_recording.service
sudo rm -rf ${RECS_DIR}/$(date +%B-%Y/%d-%A)/*
sudo systemctl start birdnet_recording.service
fi
cat ${THIS_RUN} > ${LAST_RUN}
fi
INCLUDE_LIST="$HOME/BirdNET-Pi/include_species_list.txt"
EXCLUDE_LIST="$HOME/BirdNET-Pi/exclude_species_list.txt"