Skip to content

Commit 405210d

Browse files
committed
update tasks for 2.8
1 parent 80939d0 commit 405210d

File tree

1 file changed

+35
-0
lines changed

1 file changed

+35
-0
lines changed

util/updates/update-2.8-tasks.sh

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
#!/bin/bash
2+
SECONDS=0
3+
# ---------------------------------------------------
4+
YEAR=`date '+%Y'`
5+
MONTH=`date '+%m'`
6+
DAY=`date '+%d'`
7+
# ---------------------------------------------------
8+
# source the configuration file
9+
# it must be edited and copied as ".BirdNET-BarChart" to you home directory
10+
CONFIG_FILE=${HOME}/.BirdNET-BarChart
11+
if [ -f "${CONFIG_FILE}" ]; then
12+
source ${CONFIG_FILE}
13+
else
14+
echo " "
15+
echo "${CONFIG_FILE} does not exist."
16+
echo "Run the config.sh script to create."
17+
echo " "
18+
exit 1
19+
fi
20+
# ---------------------------------------------------
21+
{
22+
# check for semaphore
23+
if [ -f "${BARCHART_HOME}/util/updates/update-2.8-tasks.lock" ]; then
24+
echo "previously run"
25+
else
26+
touch "${BARCHART_HOME}/util/updates/update-2.8-tasks.lock"
27+
echo "no action necessary"
28+
fi
29+
# cascade the update to previous tasks
30+
${BARCHART_HOME}/util/updates/update-2.8-tasks.sh
31+
# how long did it take
32+
DURATION=$SECONDS
33+
echo "$(($DURATION / 60)) minutes and $(($DURATION % 60)) seconds elapsed."
34+
} >> ${BARCHART_HOME}/logs/${YEAR}-${MONTH}-${DAY}-update-2.8-tasks.out 2>> ${BARCHART_HOME}/logs/${YEAR}-${MONTH}-${DAY}-update-2.8-tasks.err
35+
# ---------------------------------------------------

0 commit comments

Comments
 (0)