Mercurial > hg > Feedworm
annotate 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 |
rev | line source |
---|---|
165
a5bda54309ba
add a couchapp for easy/automated setup
Dirk Olmes <dirk@xanthippe.ping.de>
parents:
diff
changeset
|
1 #!/bin/bash |
a5bda54309ba
add a couchapp for easy/automated setup
Dirk Olmes <dirk@xanthippe.ping.de>
parents:
diff
changeset
|
2 |
a5bda54309ba
add a couchapp for easy/automated setup
Dirk Olmes <dirk@xanthippe.ping.de>
parents:
diff
changeset
|
3 |
a5bda54309ba
add a couchapp for easy/automated setup
Dirk Olmes <dirk@xanthippe.ping.de>
parents:
diff
changeset
|
4 BASE_URL=${1:-http://localhost:5984} |
a5bda54309ba
add a couchapp for easy/automated setup
Dirk Olmes <dirk@xanthippe.ping.de>
parents:
diff
changeset
|
5 DB_URL=${BASE_URL}/feedworm |
a5bda54309ba
add a couchapp for easy/automated setup
Dirk Olmes <dirk@xanthippe.ping.de>
parents:
diff
changeset
|
6 |
a5bda54309ba
add a couchapp for easy/automated setup
Dirk Olmes <dirk@xanthippe.ping.de>
parents:
diff
changeset
|
7 # create the database if it doesn't yet exist |
a5bda54309ba
add a couchapp for easy/automated setup
Dirk Olmes <dirk@xanthippe.ping.de>
parents:
diff
changeset
|
8 curl -f "${DB_URL}" > /dev/null 2>&1 |
a5bda54309ba
add a couchapp for easy/automated setup
Dirk Olmes <dirk@xanthippe.ping.de>
parents:
diff
changeset
|
9 if [ $? -gt 0 ]; then |
a5bda54309ba
add a couchapp for easy/automated setup
Dirk Olmes <dirk@xanthippe.ping.de>
parents:
diff
changeset
|
10 echo -n "creating the database ... " |
a5bda54309ba
add a couchapp for easy/automated setup
Dirk Olmes <dirk@xanthippe.ping.de>
parents:
diff
changeset
|
11 curl -X PUT ${DB_URL} |
a5bda54309ba
add a couchapp for easy/automated setup
Dirk Olmes <dirk@xanthippe.ping.de>
parents:
diff
changeset
|
12 fi |
a5bda54309ba
add a couchapp for easy/automated setup
Dirk Olmes <dirk@xanthippe.ping.de>
parents:
diff
changeset
|
13 |
a5bda54309ba
add a couchapp for easy/automated setup
Dirk Olmes <dirk@xanthippe.ping.de>
parents:
diff
changeset
|
14 couchapp push local |