Import original fetch.sh as fetch_fio.sh.

This commit is contained in:
Dominik Pantůček 2023-04-11 20:04:00 +02:00
parent f18d7c0d55
commit 121ea855c3

21
fetch_fio.sh Normal file
View file

@ -0,0 +1,21 @@
#!/bin/bash
while read accnt; do
ACCNO=`echo $accnt|cut -d ' ' -f 1`
APIKEY=`echo $accnt|cut -d ' ' -f 2`
echo "Processing account $ACCNO"
mv $ACCNO.csv $ACCNO.csv.old
# fetch CSV from bank
for i in `seq 1 3`; do
wget https://www.fio.cz/ib_api/rest/periods/${APIKEY}/2015-01-01/2025-01-31/transactions.csv -O $ACCNO.csv
if [ -s $ACCNO.csv ]; then
echo OK
break
else
echo Failed download, retrying in 5 s
sleep 5
fi
done
done < apikey.ntlm