-
Notifications
You must be signed in to change notification settings - Fork 22
/
couchdb_tasks_internal.sh
41 lines (36 loc) · 1.21 KB
/
couchdb_tasks_internal.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#!/usr/bin/env bash
echo "--- creating couchdb admin username and password"
curl -g -X PUT http://127.0.0.1:5986/_config/admins/$1 -d '"'$2'"' 2>/dev/null
if [ "$?" -ne 0 ]
then
echo "*** creation of admin account failed."
fi
echo "--- creation of admin account completed. May be success or failed"
echo "--- creating common db"
curl -g -X PUT http://"$1":"$2"@127.0.0.1:5984/$3 2>/dev/null
if [ "$?" -ne 0 ]
then
echo "*** creation of common db failed."
fi
echo "--- creation of common db completed. May be success or failed"
echo "--- creating _users DB"
curl -X PUT http://"$1":"$2"@127.0.0.1:5984/_users
if [ "$?" -ne 0 ]
then
echo "*** creating _users db failed."
fi
echo "--- creating _users db is completed. may be success of failed."
echo "--- creating _replicator"
curl -X PUT http://"$1":"$2"@127.0.0.1:5984/_replicator
if [ "$?" -ne 0 ]
then
echo "*** creating _replicator db failed."
fi
echo "--- creating _replicator db is completed. may be success of failed."
echo "--- creating _global_changes"
curl -X PUT http://"$1":"$2"@127.0.0.1:5984/_global_changes
if [ "$?" -ne 0 ]
then
echo "*** creating _global_changes db failed."
fi
echo "--- creating _global_changes db is completed. may be success of failed."