-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathstart-dkb.sh
executable file
·36 lines (31 loc) · 956 Bytes
/
start-dkb.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
source $HOME/.aqbanking/env
mkdir -pv csv
mkdir -pv archive
echo "# WARNING !"
echo -e "#\n#\n"
echo "# This script is obsolete and will be removed."
echo "# Take a look into the README"
echo "# sleeping 5s"
sleep 5
#
# generate new csv
IMAGE=ghcr.io/devfaz/firefly-iii-dkb:latest
podman run --rm --pull=newer --userns=keep-id -it -v $HOME/.aqbanking/:/home/aqbanking/.aqbanking/ --entrypoint /usr/local/bin/gencsv.sh $IMAGE
echo "Moving generated csv into local directory"
find $HOME/.aqbanking/ -type f -name '*.csv' -print0 | xargs -0 -r -i mv -v {} .
echo "---"
#
# push csv to firefly-iii
for KTO in ${KTOS}
do
FILE=$( find . -name "${KTO}*" )
if [ -n "${AUTOIMPORT_URL}" ] && [ -e "import_config_${KTO}.json" ] && [ -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
done