Mercurial > hg > Feedworm
diff backend/couchdb/CouchApp/feedworm/setup.sh @ 165:a5bda54309ba
add a couchapp for easy/automated setup
author | Dirk Olmes <dirk@xanthippe.ping.de> |
---|---|
date | Mon, 29 Aug 2011 04:12:01 +0200 |
parents | |
children | 98eaf0075a44 |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/backend/couchdb/CouchApp/feedworm/setup.sh Mon Aug 29 04:12:01 2011 +0200 @@ -0,0 +1,14 @@ +#!/bin/bash + + +BASE_URL=${1:-http://localhost:5984} +DB_URL=${BASE_URL}/feedworm + +# create the database if it doesn't yet exist +curl -f "${DB_URL}" > /dev/null 2>&1 +if [ $? -gt 0 ]; then + echo -n "creating the database ... " + curl -X PUT ${DB_URL} +fi + +couchapp push local