scripts/couchdb-client.sh
PlexSheep 71f31bc645
tons of little scripts
Signed-off-by: PlexSheep <software@cscherr.de>
2025-01-23 11:12:51 +01:00

14 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"
}