added 12/24h timestamp formatting as birdnet.conf variable

defaults to 24h timestamps

working on species_notifier.sh
This commit is contained in:
Patrick McGuire
2021-09-30 14:19:35 -04:00
parent c2bb057999
commit 50d6a56ae5
6 changed files with 94 additions and 22 deletions
+8 -2
View File
@@ -2,15 +2,21 @@
set -x
source /etc/birdnet/birdnet.conf
if [ "${TIMESTAMP_FORMAT}" == "12" ];then
STAMP="%I:%M:%S%P"
else
STAMP="%H:%M:%S"
fi
if pgrep arecord &> /dev/null ;then
echo "Recording"
else
if [ -z ${REC_CARD} ];then
arecord -f S16_LE -c${CHANNELS} -r48000 -t wav --max-file-time 9\
--use-strftime ${RECS_DIR}/%B-%Y/%d-%A/%F-birdnet-%I:%M:%S%P.wav
--use-strftime ${RECS_DIR}/%B-%Y/%d-%A/%F-birdnet-${STAMP}.wav
else
arecord -f S16_LE -c${CHANNELS} -r48000 -t wav --max-file-time 9\
-D "${REC_CARD}" --use-strftime \
${RECS_DIR}/%B-%Y/%d-%A/%F-birdnet-%I:%M:%S%P.wav
${RECS_DIR}/%B-%Y/%d-%A/%F-birdnet-${STAMP}.wav
fi
fi