diff options
author | David Phillips <david@sighup.nz> | 2017-04-20 16:17:35 +1200 |
---|---|---|
committer | David Phillips <david@sighup.nz> | 2017-04-20 16:17:35 +1200 |
commit | 388b96ed31de2cb7195ba2b3f9126e7e02329a2f (patch) | |
tree | c2f353f55c81bfa2e87d890ec421643f359c1723 | |
parent | 04fcec2c19fd804482f12245f5bf0575e4c64e5d (diff) | |
download | dotfiles-388b96ed31de2cb7195ba2b3f9126e7e02329a2f.tar.xz |
grab-spot: download if non-existant too
-rwxr-xr-x | local/bin/grab-spot | 2 |
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" |