-
-
Save Lajule/4b5610dc2055368af0ba2ff13e0b50bc to your computer and use it in GitHub Desktop.
Download file from S3
This file contains hidden or 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 | |
| if (( $# < 4 )); then | |
| echo 'Missing arguments' >&2 | |
| exit 1 | |
| fi | |
| UTC="$(date -R --utc)" | |
| http -d "$1/$2" \ | |
| "Host:$1" \ | |
| "Date:${UTC}" \ | |
| "Authorization:AWS $3:$(printf "GET\n\n\n%s\n/%s" "${UTC}" "$2" | openssl sha1 -hmac "$4" -binary | base64)" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment