Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- mongod --dbpath /data/db &
- RET=1
- while [[ RET -ne 0 ]]; do
- echo "=> Waiting for confirmation of MongoDB service startup"
- sleep 5
- mongo admin --eval "help" >/dev/null 2>&1
- RET=$?
- done
- ADMINUSER=rootUser
- ADMINPASS=changeMe
- DBUSER=opal
- DBPASSWORD=opal
- mongo admin --eval "db.createUser({user: '$ADMINUSER', pwd: '$ADMINPASS', roles:[{role:'root',db:'admin'}]});"
- mongo opaldb --eval "db.createUser({user: '$DBUSER', pwd: '$DBPASSWORD', roles:[{role:'dbOwner',db:'opaldb'}]});"
- mongod --shutdown
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement