Created
March 7, 2018 21:11
-
-
Save jasonmimick/7c21ab223397feb01c4fe49c37e4376e to your computer and use it in GitHub Desktop.
This file contains 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 | |
dir=$(pwd) | |
dbpath="${dir}/mms-app-db" | |
lock="${dbpath}/mongodb.lock" | |
shell="${dir}/mongodb-linux*/bin/mongo" | |
# if lock stop | |
if [ ! -f ${lock} ]; then | |
echo "mongodb running, shutting down..." | |
${shell} admin --eval 'db.shutdownServer()' | |
sleep 2 | |
fi | |
${dir}/mongodb-linux*/bin/mongod --dbpath=${dbpath} \ | |
--logpath=${dbpath}/mongodb.log \ | |
--wiredTigerCacheSizeGB=10 \ | |
--fork | |
sleep 2 | |
mongo_up=$(${shell} --eval 'db.serverStatus()') | |
echo "mongo_up=${mongo_up}" | |
${dir}/mongodb-mms*/bin/mongodb-mms start |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment