view backend/couchdb/CouchApp/feedworm/setup.sh @ 176:7001070d0bd5

clean code
author dirk
date Fri, 09 Sep 2011 18:19:01 +0200
parents a5bda54309ba
children 98eaf0075a44
line wrap: on
line source

#!/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