Impl storage mongo driver and config
This commit is contained in:
23
init.sh
Normal file
23
init.sh
Normal file
@@ -0,0 +1,23 @@
|
||||
#! /bin/bash
|
||||
|
||||
port=57017
|
||||
|
||||
if ! curl -sS localhost:$port > /dev/null; then
|
||||
prefix=/tmp/whodunit.db
|
||||
mkdir -p $prefix/data
|
||||
mongod \
|
||||
--dbpath $prefix/data \
|
||||
--logpath $prefix/log \
|
||||
--pidfilepath $prefix/pid \
|
||||
--port $port \
|
||||
--fork
|
||||
fi
|
||||
|
||||
mshell() {
|
||||
mongo \
|
||||
--quiet \
|
||||
--port $port \
|
||||
--eval "$*"
|
||||
}
|
||||
|
||||
export DBURI=${DB_URI:-"mongodb://localhost:$port"}
|
||||
Reference in New Issue
Block a user