Skip to content

Instantly share code, notes, and snippets.

@nownabe
Last active August 29, 2015 14:04
Show Gist options
  • Save nownabe/60d9a6f4e6034c2e5eae to your computer and use it in GitHub Desktop.
Save nownabe/60d9a6f4e6034c2e5eae to your computer and use it in GitHub Desktop.
riakput.sh
#!/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