Last active
August 29, 2015 14:04
-
-
Save nownabe/60d9a6f4e6034c2e5eae to your computer and use it in GitHub Desktop.
riakput.sh
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 | |
## For 7 databases in 7 worlds | |
## | |
## Install: | |
## $ wget -O riakput.sh https://gist.github.com/nownabe/60d9a6f4e6034c2e5eae/raw/406d2a7a08a5d1ce5afd993786c11293cf3e949a/gistfile1.sh | |
## $ chmod +x riakput.sh | |
## Usage: | |
## $ echo '{"nickname": "Sweet Polly Purebred", "breed": "Purebred"}' | ./riakput.sh animal polly application/json | |
bucket=$1 | |
key=$2 | |
contenttype=$3 | |
cmd="curl -v -X PUT http://localhost:10018/buckets/${bucket}/keys/${key}" | |
cmd="${cmd} -H \"Content-Type: ${contenttype}\"" | |
cmd="${cmd} -d '$(cat -)'" | |
eval ${cmd} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment