Last active
October 9, 2017 00:27
-
-
Save nucklehead/8f7b75a43de856d69f40b44d7354ace8 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 -ex | |
rm -rf db | |
mkdir db | |
mongod --dbpath db & | |
sleep 1 | |
mongo mydatabase --eval 'db.createUser({user: "admin", pwd: "password", roles: [{ role: "userAdminAnyDatabase", db: "admin" }]})' | |
sleep 1 | |
pkill mongod | |
mongod --auth --dbpath db |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment