diff options
author | Petter Reinholdtsen <pere@hungry.com> | 2012-12-05 19:41:52 +0100 |
---|---|---|
committer | Holger Levsen <holger@layer-acht.org> | 2012-12-05 23:35:57 +0100 |
commit | 25c046abb3898aca38ea7ec8890942eb1516988b (patch) | |
tree | 6ba6fd78a51f400b60c2b890d18ec556b76a5163 | |
parent | 5e1558ae35d81f023c35c3102db98017aef8c88a (diff) | |
download | jenkins.debian.net-25c046abb3898aca38ea7ec8890942eb1516988b.tar.xz |
Download new ISO only when it is changed at the source.
-rwxr-xr-x | bin/cd_tester.sh | 10 |
1 files 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 |