Parse start year information.
This commit is contained in:
parent
2546f40871
commit
474c5a06fa
1 changed files with 28 additions and 21 deletions
11
fetch_fio.sh
11
fetch_fio.sh
|
@ -105,13 +105,19 @@ log "$0" ======== started ========
|
|||
# two non-whitespace strings. The rest of each line is ignored. There
|
||||
# must be no leading whitespace.
|
||||
while read accnt; do
|
||||
# Extract account number and Fio token
|
||||
# Extract account number, Fio token and starting year
|
||||
ACCNO=${accnt%% *}
|
||||
accrest=${accnt#* }
|
||||
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 "Processing account $ACCNO"
|
||||
log "Processing account $ACCNO starting $YEAR"
|
||||
|
||||
# Fetch CSV from bank
|
||||
CSVNAME="$BANK_DIR/$ACCNO.csv"
|
||||
|
@ -132,6 +138,7 @@ while read accnt; do
|
|||
sleep 5
|
||||
fi
|
||||
done
|
||||
fi
|
||||
done < "$APIKEYS_FILE"
|
||||
|
||||
# Mark
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue