15 lines
383 B
Bash
15 lines
383 B
Bash
|
export COUCHDB_HOST=couchdb.homeserver.box
|
||
|
export COUCHDB_USER=admin
|
||
|
export COUCHDB_PASSWORD=setme
|
||
|
export COUCHDB
|
||
|
function couchdb() {
|
||
|
if [[ -z "$1" ]] || [[ -z "$2" ]] || [[ -n "$3" ]]; then
|
||
|
echo "USAGE: $0 METHOD URI"
|
||
|
return 1
|
||
|
fi
|
||
|
method=$1
|
||
|
local="https://${COUCHDB_USER}:${COUCHDB_PASSWORD}@${COUCHDB_HOST}/${2}"
|
||
|
echo "request: $method $local"
|
||
|
curl -X $method "$local"
|
||
|
}
|