3
# Get the randomly-generated port for desktopcouch
4
PORT=$(dbus-send --session --dest=org.desktopcouch.CouchDB --print-reply --type=method_call / org.desktopcouch.CouchDB.getPort | sed -e 's/^.* //' | tail -1)
3
# Get the currently-known port
5
# Get the admin username and password for couchdb
7
DB_RESPONSE=$(curl http://$AUTH@localhost:$PORT/)
8
# Test to see if the currently-known port works
9
if [ `expr match "$DB_RESPONSE" "{\"couchdb\":\"Welcome\",\"version\".*"` -gt 0 ] ;
11
echo "We have the right port! So we aren't modifying the filesystem."
13
echo "We don't have the right port yet. So we'll get it and write it to port.txt."
14
# Get the randomly-generated port for desktopcouch
15
PORT=$(dbus-send --session --dest=org.desktopcouch.CouchDB --print-reply --type=method_call / org.desktopcouch.CouchDB.getPort | sed -e 's/^.* //' | tail -1)