have birdstats.local (birdnet_stats.sh) working okay, not great
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
#!/usr/bin/env bash
|
||||
# Update the species list
|
||||
# set -x
|
||||
#set -x
|
||||
trap 'rm -f "$TMPFILE"' SIGINT SIGTERM EXIT
|
||||
|
||||
source /etc/birdnet/birdnet.conf
|
||||
@@ -11,14 +11,11 @@ TMPFILE=$(mktemp) || exit 1
|
||||
|
||||
IDFILEBAKUP="${IDFILE}.bak"
|
||||
|
||||
if [ $(find ${ANALYZED} -name '*txt' | wc -l) -ge 1 ];then
|
||||
sort $(find ${ANALYZED} -name '*txt') \
|
||||
| awk '/Spect/ {for(i=11;i<=NF;++i)printf $i""FS ; print ""}' \
|
||||
| cut -d'0' -f1 \
|
||||
| sort -u > "$TMPFILE"
|
||||
cat "$IDFILE" >> "$TMPFILE"
|
||||
cp "$IDFILE" "$IDFILEBAKUP"
|
||||
sort -u "$TMPFILE" > "$IDFILE"
|
||||
if [ $(find ${PROCESSED} -name '*csv' | wc -l) -ge 1 ];then
|
||||
sort $(find ${PROCESSED} ${ANALYZED} ${EXTRACTED} -name '*csv') \
|
||||
| awk -F\; '!/Scientific/ {print"Common Name: " $4 "\nScientific Name: " $3""}' \
|
||||
| uniq > "$TMPFILE"
|
||||
cat "$TMPFILE" | awk '!visited[$0]++' > "$IDFILE"
|
||||
cat "$IDFILE"
|
||||
else
|
||||
cat "$IDFILE"
|
||||
|
||||
Reference in New Issue
Block a user