Skip to content

Instantly share code, notes, and snippets.

@spjmurray
Created October 2, 2014 14:47
Show Gist options
  • Save spjmurray/0f54d01e8613b6bcd49a to your computer and use it in GitHub Desktop.
Save spjmurray/0f54d01e8613b6bcd49a to your computer and use it in GitHub Desktop.
S3 Bucket Get
#!/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