From 62dbcd4ac29876ebd9c088334138c2295a47eaff Mon Sep 17 00:00:00 2001 From: Jon Shaulis Date: Wed, 31 Aug 2016 21:02:15 -0400 Subject: [PATCH] Fix issue with missed checksum check --- plexupdate.sh | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/plexupdate.sh b/plexupdate.sh index a459d0c..5a2257e 100755 --- a/plexupdate.sh +++ b/plexupdate.sh @@ -501,11 +501,17 @@ fi if [ -f "${DOWNLOADDIR}/${FILENAME}" ]; then if [ "${FORCE}" != "yes" -a "${FORCEALL}" != "yes" ]; then - echo "File already exists (${FILENAME}), won't download." - if [ "${AUTOINSTALL}" != "yes" ]; then - cronexit 2 + sha1sum --status -c "${DOWNLOADDIR}/${FILENAME}.sha" + if [ $? -eq 0 ]; then + echo "File already exists (${FILENAME}), won't download." + if [ "${AUTOINSTALL}" != "yes" ]; then + cronexit 2 + fi + SKIP_DOWNLOAD="yes" + else + echo "File exists but fails checksum. Redownloading." + SKIP_DOWNLOAD="no" fi - SKIP_DOWNLOAD="yes" elif [ "${FORCEALL}" == "yes" ]; then echo "Note! File exists, but asked to overwrite with new copy" else