From 25c046abb3898aca38ea7ec8890942eb1516988b Mon Sep 17 00:00:00 2001 From: Petter Reinholdtsen Date: Wed, 5 Dec 2012 19:41:52 +0100 Subject: Download new ISO only when it is changed at the source. --- bin/cd_tester.sh | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/bin/cd_tester.sh b/bin/cd_tester.sh index 52f41f32..fc1ab1bc 100755 --- a/bin/cd_tester.sh +++ b/bin/cd_tester.sh @@ -170,10 +170,14 @@ trap cleanup_all INT TERM EXIT # if there is a CD image... # if [ ! -z $IMAGE ] ; then - # only download if $IMAGE is older than a week (60*24*7=10080) (+9500 is a bit less than a week) - if test $(find $IMAGE -mmin +9500) || ! test -f $IMAGE ; then - curl $URL > $IMAGE + + # Only download if newer image is avaiable + CURLOPTS="" + if [ -f $IMAGE ] ; then + CURLOPTS="-z $IMAGE" fi + curl $CURLOPTS -o $IMAGE $URL + sudo mkdir -p $IMAGE_MNT mount | grep -v grep | grep $IMAGE_MNT && sudo umount -l $IMAGE_MNT sleep 1 -- cgit v1.2.3-70-g09d2