-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathentrypoint.sh
37 lines (31 loc) · 918 Bytes
/
entrypoint.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#!/bin/bash
set -e -o pipefail
# podman run --rm --pull=newer -it -v $HOME/.aqbanking/:/root/.aqbanking/ ghcr.io/devfaz/firefly-iii-dkb:latest /usr/local/bin/gencsv.sh
if [ ! -r $HOME/.aqbanking/env ]; then
echo "Missing ENV-File"
exit 1
fi
cd $HOME/.aqbanking
source $HOME/.aqbanking/env
mkdir -pv csv
mkdir -pv archive
mkdir -pv balance
#
# generate new csv
gencsv.sh
# push csv to firefly-iii
if [ -n "${AUTOIMPORT_URL}" ]; then
for KTO in ${KTOS}
do
if [ -e "import_config_${KTO}.json" ]; then
FILE=$( find . -maxdepth 1 -name "${KTO}*.csv" )
if [ -n "${FILE}" ] && [ -e "${FILE}" ]; then
echo "Starting auto-import of ${KTO}"
mv -v "${FILE}" "${KTO}.csv"
autoimport.sh ${KTO}
mv -v "${KTO}.csv" "archive/$( date +%F )_${KTO}.csv"
echo "---"
fi
fi
done
fi