Parse start year information.

This commit is contained in:
Dominik Pantůček 2023-05-25 15:43:44 +02:00
parent 2546f40871
commit 474c5a06fa

View file

@ -105,13 +105,19 @@ log "$0" ======== started ========
# two non-whitespace strings. The rest of each line is ignored. There # two non-whitespace strings. The rest of each line is ignored. There
# must be no leading whitespace. # must be no leading whitespace.
while read accnt; do while read accnt; do
# Extract account number and Fio token # Extract account number, Fio token and starting year
ACCNO=${accnt%% *} ACCNO=${accnt%% *}
accrest=${accnt#* } accrest=${accnt#* }
APIKEY=${accrest%% *} APIKEY=${accrest%% *}
accrest2=${accrest#* }
YEAR=${accrest2%% *}
# Check starting year before attempting partial downloads
if [ -z "$YEAR" ] ; then
log "Missing start year for account $ACCNO"
else
# Log action # Log action
log "Processing account $ACCNO" log "Processing account $ACCNO starting $YEAR"
# Fetch CSV from bank # Fetch CSV from bank
CSVNAME="$BANK_DIR/$ACCNO.csv" CSVNAME="$BANK_DIR/$ACCNO.csv"
@ -132,6 +138,7 @@ while read accnt; do
sleep 5 sleep 5
fi fi
done done
fi
done < "$APIKEYS_FILE" done < "$APIKEYS_FILE"
# Mark # Mark