Skip to content

Instantly share code, notes, and snippets.

@hostmaster
Created May 5, 2016 07:37
Show Gist options
  • Save hostmaster/3556904f86bc69bae084842910970326 to your computer and use it in GitHub Desktop.
Save hostmaster/3556904f86bc69bae084842910970326 to your computer and use it in GitHub Desktop.
#!/bin/bash
URL=http://S3_BUCKET.s3.amazonaws.com/FILENAME
filename=FILENAME
S3_MD5=$(curl -s -I -L $URL | awk '/ETag/ { gsub(/"|\r/,"",$2); print $2 }')
MD5="$(md5 -q $filename 2>/dev/null || :)"
if [ "$S3_MD5" != "$MD5" ]; then
echo "Download"
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment