Created
May 11, 2017 09:29
-
-
Save MikeMichel/048706f088c895f40fc6f29231a5cf2a to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
#enable job control in script | |
set -m | |
# when /etc/couchdb (contains i.g. admin account) was not allready moved to persistant storage, do it and symlink the org. directory | |
if [ ! -d /var/lib/couchdb/etc/couchdb ]; then | |
mkdir /var/lib/couchdb/etc | |
mv /etc/couchdb /var/lib/couchdb/etc/ | |
ln -s /var/lib/couchdb/etc/couchdb/ /etc/couchdb | |
else | |
rm -rf /etc/couchdb | |
ln -s /var/lib/couchdb/etc/couchdb/local.ini /etc/couchdb/local.ini | |
ln -s /var/lib/couchdb/etc/couchdb/default.ini /etc/couchdb/default.ini | |
fi | |
#run CouchDB in background | |
couchdb & | |
#set password for admin account | |
if [ ! `/bin/grep ^admin /etc/couchdb/local.ini` ]; then | |
/create_couchdb_admin_user.sh | |
fi | |
#bring couchdb to foreground | |
fg |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment