seems to work

This commit is contained in:
Patrick McGuire
2021-10-15 19:48:39 -04:00
parent 4f03fea42a
commit ae3e29ef1d
4 changed files with 52 additions and 12 deletions
+5 -5
View File
@@ -1,19 +1,19 @@
#!/usr/bin/env bash
# Sends a notification if a new species is detected
#set -x
trap 'rm -f $TMPFILE' EXIT
trap 'rm -f $tmpids' EXIT
source /etc/birdnet/birdnet.conf
TMPFILE=$(mktemp)
tmpids=$(mktemp)
[ -f ${IDFILE} ] || touch ${IDFILE}
cat "${IDFILE}" > "${TMPFILE}"
cat "${IDFILE}" > "${tmpids}"
/usr/local/bin/update_species.sh > /dev/null
if ! diff "${IDFILE}" "${TMPFILE}" &> /dev/null; then
SPECIES=("$(diff "${IDFILE}" "${TMPFILE}" \
if ! diff "${IDFILE}" "${tmpids}" &> /dev/null; then
SPECIES=("$(diff "${IDFILE}" "${tmpids}" \
| grep "Common Name" \
| sort \
| awk '{for(i=4;i<=NF;++i)printf $i""FS ; print ""}')")