Skip to content

Instantly share code, notes, and snippets.

@shino
Created January 21, 2016 02:18
Show Gist options
  • Save shino/26b88513eb93c11281f2 to your computer and use it in GitHub Desktop.
Save shino/26b88513eb93c11281f2 to your computer and use it in GitHub Desktop.
#!/bin/bash
trap 'echo "$0($LINENO) \"$BASH_COMMAND\"" ; exit 1' ERR
export S3CURL=.s3curl.15018.alice
s3curl.pl --id cs \
--contentType 'application/xml' \
-- \
-d @- \
--trace-ascii - \
-s \
-X PUT \
-x localhost:15018 \
http://test-acl.s3.amazonaws.com/'?acl' \
<<EOF
<?xml version="1.0" encoding="UTF-8"?>
<AccessControlPolicy xmlns="http://data.basho.com/doc/2012-04-05/">
<Owner>
<ID>76e888f9b086d07ffa4f9e783e98e33790a290441b3ca8afead6f5f7fce8737d</ID>
<DisplayName>alice</DisplayName>
</Owner>
<AccessControlList>
<Grant>
<Grantee xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="CanonicalUser">
<ID>76e888f9b086d07ffa4f9e783e98e33790a290441b3ca8afead6f5f7fce8737d</ID>
<DisplayName>alice</DisplayName>
</Grantee>
<Permission>FULL_CONTROL</Permission>
</Grant>
<Grant>
<Grantee xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="CanonicalUser">
<ID>d8348a7b7ecba72043c2335f37b01fc0c0a5847bec4c57bb5dad7fcd6f4cca30</ID>
</Grantee>
<Permission>FULL_CONTROL</Permission>
</Grant>
</AccessControlList>
</AccessControlPolicy>
EOF
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment