From 95cbf0713677cb68db26f9222b8853beb5ec41ed Mon Sep 17 00:00:00 2001 From: John-Mark Gurney Date: Sat, 10 Nov 2018 15:58:05 -0800 Subject: [PATCH] If the image already exists, don't re-dl, just verify the existing image. --- snapaid.sh | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/snapaid.sh b/snapaid.sh index 3402a85..6f2794f 100755 --- a/snapaid.sh +++ b/snapaid.sh @@ -255,8 +255,12 @@ dlverify() { return 1 fi - # fetch link - $WGET -- "$dlurl" + if ! [ -f $(basename "$dlurl") ]; then + # fetch link + $WGET -- "$dlurl" + else + echo 'Image already exists, verifying...' + fi if ! verifyfile "$vermid" "$fname"; then echo 'Removing bad file.'