libsqreen 0.3.0.0.3 → 0.6.1.0.0

Sign up to get free protection for your applications and to get access to all the features.
data/s3get DELETED
@@ -1,47 +0,0 @@
1
- #!/bin/bash
2
-
3
- set -e
4
- set -u
5
-
6
- access_key="${AWS_ACCESS_KEY}"
7
- secret_key="${AWS_SECRET_KEY}"
8
-
9
- tgt="${*:$#}"
10
- src=("${@:1:$# - 1}")
11
- bucket="${src%%.*}"
12
- host_bucket="${src%%/*}"
13
- host_base="${host_bucket#*.}"
14
- dst="${tgt}"
15
-
16
- if [[ "${#src[@]}" = 0 ]]; then
17
- exit 1
18
- fi
19
-
20
- if [[ ! "$dst" =~ .*/$ ]]; then
21
- if [[ "${#src[@]}" -gt 1 ]]; then
22
- exit 1
23
- fi
24
- fi
25
-
26
- for s in "${src[@]}"; do
27
- p="${s#*/}"
28
- if [[ ! "$dst" =~ .*/$ ]]; then
29
- f="${dst}"
30
- else
31
- f="${dst}${p}"
32
- fi
33
- d="${f%/*}"
34
-
35
- resource="/${bucket}/${p}"
36
- content_type='binary/octet-stream'
37
- date="$(date -u -R)"
38
- payload="GET\n\n${content_type}\n${date}\n${resource}"
39
- signature=$(echo -en "${payload}" | openssl sha1 -hmac "${secret_key}" -binary | base64)
40
- mkdir -p "$d"
41
- curl -X GET -o "${f}" \
42
- -H "Host: ${host_bucket}" \
43
- -H "Date: ${date}" \
44
- -H "Content-Type: ${content_type}" \
45
- -H "Authorization: AWS ${access_key}:${signature}" \
46
- "https://${host_bucket}/${p}"
47
- done