Mercurial > hg > Feedworm
annotate backend/couchdb/CouchApp/feedworm/setup.sh @ 221:a383abe2e81a
update to python3
author | Dirk Olmes <dirk@xanthippe.ping.de> |
---|---|
date | Thu, 22 May 2014 05:10:51 +0200 |
parents | 98eaf0075a44 |
children |
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 BASE_URL=${1:-http://localhost:5984} |
a5bda54309ba
add a couchapp for easy/automated setup
Dirk Olmes <dirk@xanthippe.ping.de>
parents:
diff
changeset
|
4 DB_URL=${BASE_URL}/feedworm |
a5bda54309ba
add a couchapp for easy/automated setup
Dirk Olmes <dirk@xanthippe.ping.de>
parents:
diff
changeset
|
5 |
a5bda54309ba
add a couchapp for easy/automated setup
Dirk Olmes <dirk@xanthippe.ping.de>
parents:
diff
changeset
|
6 # 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
|
7 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
|
8 if [ $? -gt 0 ]; then |
a5bda54309ba
add a couchapp for easy/automated setup
Dirk Olmes <dirk@xanthippe.ping.de>
parents:
diff
changeset
|
9 echo -n "creating the database ... " |
a5bda54309ba
add a couchapp for easy/automated setup
Dirk Olmes <dirk@xanthippe.ping.de>
parents:
diff
changeset
|
10 curl -X PUT ${DB_URL} |
a5bda54309ba
add a couchapp for easy/automated setup
Dirk Olmes <dirk@xanthippe.ping.de>
parents:
diff
changeset
|
11 fi |
a5bda54309ba
add a couchapp for easy/automated setup
Dirk Olmes <dirk@xanthippe.ping.de>
parents:
diff
changeset
|
12 |
177
98eaf0075a44
make setup.sh work with non-local coucdhb URLs
Dirk Olmes <dirk@xanthippe.ping.de>
parents:
165
diff
changeset
|
13 couchapp push ${DB_URL} |