From 2d9ad804bb544f0a9e76d3252ffcd4fb8608bb35 Mon Sep 17 00:00:00 2001 From: mxmehl Date: Tue, 16 Jun 2015 13:26:52 +0300 Subject: [PATCH] fixing missing deletion of wrong-md5 partial file --- split-dl.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/split-dl.sh b/split-dl.sh index 7d855c5..fe749f6 100755 --- a/split-dl.sh +++ b/split-dl.sh @@ -180,6 +180,8 @@ for ((i = 0; i < ${#SMALLNAME[*]}; i++)); do elif [ -e $SMALLPATH ] && [ $(du $SMALLPATH | awk -F" " '{ print $1 }') == $SMALLSIZE ] && [ $(md5sum $SMALLPATH | awk -F" " '{ print $1 }') != $SMALLMD5 ]; then echo "[ERROR] MD5 is different but file has same size." echo "[INFO] Deleting file and starting new download." + checkwait + rm $SMALLPATH wget -O $SMALLPATH $SMALLURL # File already exists, has correct size, and has correct MD5