summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Phillips <david@sighup.nz>2017-04-20 16:17:35 +1200
committerDavid Phillips <david@sighup.nz>2017-04-20 16:17:35 +1200
commit388b96ed31de2cb7195ba2b3f9126e7e02329a2f (patch)
treec2f353f55c81bfa2e87d890ec421643f359c1723
parent04fcec2c19fd804482f12245f5bf0575e4c64e5d (diff)
downloaddotfiles-388b96ed31de2cb7195ba2b3f9126e7e02329a2f.tar.xz
grab-spot: download if non-existant too
-rwxr-xr-xlocal/bin/grab-spot2
1 files changed, 1 insertions, 1 deletions
diff --git a/local/bin/grab-spot b/local/bin/grab-spot
index de49f12..d116252 100755
--- a/local/bin/grab-spot
+++ b/local/bin/grab-spot
@@ -9,7 +9,7 @@ if [ -z $2 ]; then
fi
# Only bother downloading if it's more than 3 hours old
-if [ $(find ~/.cache/"$1$2" -mmin +60) ] ; then
+if ([ ! -f ~/.cache/"$1$2" ] || [ $(find ~/.cache/"$1$2" -mmin +60) ]) ; then
rate=$(curl "http://rate-exchange-1.appspot.com/currency?from=$1&to=$2" | jshon -e rate)
if [ $? -ne 0 ] ; then
logger "$0: curl error"