From 388b96ed31de2cb7195ba2b3f9126e7e02329a2f Mon Sep 17 00:00:00 2001 From: David Phillips Date: Thu, 20 Apr 2017 16:17:35 +1200 Subject: grab-spot: download if non-existant too --- local/bin/grab-spot | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'local/bin/grab-spot') 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" -- cgit v1.1