diff options
| author | jc0b <j.burley@vu.nl> | 2020-04-23 14:59:48 +0200 |
|---|---|---|
| committer | jc0b <j.burley@vu.nl> | 2020-06-09 14:51:50 +0200 |
| commit | 3e182d0476637fca2ee618d26aa6776f0e20b2c7 (patch) | |
| tree | e556fbd633b979d7c233630d4692ed2e922d47df /mongodb/mongo-init-opendc-db.sh | |
| parent | 8d8486bef1b08fbc43cc100cca83fe6d8bc09f28 (diff) | |
Added basic mongodb framework
Diffstat (limited to 'mongodb/mongo-init-opendc-db.sh')
| -rw-r--r-- | mongodb/mongo-init-opendc-db.sh | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/mongodb/mongo-init-opendc-db.sh b/mongodb/mongo-init-opendc-db.sh new file mode 100644 index 00000000..55e9ec68 --- /dev/null +++ b/mongodb/mongo-init-opendc-db.sh @@ -0,0 +1,12 @@ +#!/bin/bash + +echo 'Creating opendc user and db' + +mongo opendc \ + --host localhost \ + --port 27017 \ + -u $MONGO_INITDB_ROOT_USERNAME \ + -p $MONGO_INITDB_ROOT_PASSWORD \ + --authenticationDatabase admin \ + --eval "db.createUser({user: 'opendc', pwd: 'opendcpassword', roles:[{role:'dbOwner', db: 'opendc'}]});" +$MONGO_CMD = "mongo opendc --host localhost --port 27017 -u $MONGO_INITDB_ROOT_USERNAME -p $MONGO_INITDB_ROOT_PASSWORD --authenticationDatabase admin"
\ No newline at end of file |
