Fix variable quoting.
This commit is contained in:
parent
642958ec6e
commit
cafba67089
1 changed files with 8 additions and 8 deletions
16
fetch_fio.sh
16
fetch_fio.sh
|
@ -93,11 +93,11 @@ fi
|
||||||
#
|
#
|
||||||
# Very simple "logging" function (stdout should be redirected to log anyway)
|
# Very simple "logging" function (stdout should be redirected to log anyway)
|
||||||
log() {
|
log() {
|
||||||
echo `date '+%Y-%m-%d %H:%M:%S'` $@
|
echo `date '+%Y-%m-%d %H:%M:%S'` "$@"
|
||||||
}
|
}
|
||||||
|
|
||||||
# Mark
|
# Mark
|
||||||
log $0 ======== started ========
|
log "$0" ======== started ========
|
||||||
|
|
||||||
# Each line should contain account number and Fio API token as first
|
# Each line should contain account number and Fio API token as first
|
||||||
# two non-whitespace strings. The rest of each line is ignored. There
|
# two non-whitespace strings. The rest of each line is ignored. There
|
||||||
|
@ -114,11 +114,11 @@ while read accnt; do
|
||||||
# Fetch CSV from bank
|
# Fetch CSV from bank
|
||||||
CSVNAME="$BANK_DIR/$ACCNO.csv"
|
CSVNAME="$BANK_DIR/$ACCNO.csv"
|
||||||
for i in `seq 1 3` ; do
|
for i in `seq 1 3` ; do
|
||||||
if wget -q $APIURI/periods/${APIKEY}/2015-01-01/2025-01-31/transactions.csv -O $CSVNAME.tmp ; then
|
if wget -q "${APIURI}/periods/${APIKEY}/2015-01-01/2025-01-31/transactions.csv" -O "$CSVNAME.tmp" ; then
|
||||||
if [ -s $CSVNAME.tmp ] ; then
|
if [ -s "$CSVNAME.tmp" ] ; then
|
||||||
log Download OK
|
log Download OK
|
||||||
cp $CSVNAME $CSVNAME.old
|
cp "$CSVNAME" "$CSVNAME.old"
|
||||||
mv $CSVNAME.tmp $CSVNAME
|
mv "$CSVNAME.tmp" "$CSVNAME"
|
||||||
log Finished
|
log Finished
|
||||||
break
|
break
|
||||||
else
|
else
|
||||||
|
@ -130,7 +130,7 @@ while read accnt; do
|
||||||
sleep 5
|
sleep 5
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
done < $APIKEYS_FILE
|
done < "$APIKEYS_FILE"
|
||||||
|
|
||||||
# Mark
|
# Mark
|
||||||
log $0 finished
|
log "$0" finished
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue