Created
October 2, 2014 14:47
-
-
Save spjmurray/0f54d01e8613b6bcd49a to your computer and use it in GitHub Desktop.
S3 Bucket Get
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
token='I858I8ZG0L80D9D8EQI8' | |
secret='cWIxgBEzPWmZcUsmbreXfT8gJvn9PIbCsQO9Bvtr' | |
query=$1 | |
date=`date -Ru` | |
header="GET\n${content_md5}\n${content_type}\n${date}\n${query}" | |
sig=`echo -en ${header} | openssl sha1 -hmac ${secret} -binary | base64` | |
curl -X GET \ | |
-H "Date: ${date}" \ | |
-H "Authorization: AWS ${token}:${sig}" \ | |
"https://storage.datacentred.io${query}" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment