From bfd7d71ba7c26170f446d8bc9d1bed8909109560 Mon Sep 17 00:00:00 2001 From: Drew Bednar Date: Wed, 12 Aug 2020 15:06:41 -0400 Subject: [PATCH] adding profile script with convenience functions --- scripts/mongo_profile | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 scripts/mongo_profile diff --git a/scripts/mongo_profile b/scripts/mongo_profile new file mode 100644 index 0000000..703f6a8 --- /dev/null +++ b/scripts/mongo_profile @@ -0,0 +1,16 @@ +#!/usr/bin/env bash + +export MONGO_CA_CERT="${HOME}/certs/mongo_dev/mongod.crt" +export MONGO_PEM_CERT="${HOME}/certs/mongo_dev/mongod.pem" + +restore_bookstore() { + mongorestore -u toor -p ${1} --authenticationDatabase 'admin' --ssl --host docker1 --sslCAFile ${MONGO_CA_CERT} --sslPEMKeyFile ${MONGO_PEM_CERT} --sslAllowInvalidCertificates --drop --db bookstore ./ data/bookstore +} + +restore_dealership (){ + mongorestore -u toor -p ${1} --authenticationDatabase 'admin' --ssl --host docker1 --sslCAFile ${MONGO_CA_CERT} --sslPEMKeyFile ${MONGO_PEM_CERT} --sslAllowInvalidCertificates --drop --db dealership ./data/de alership +} + +mongo_dev_connect (){ + mongo -u toor -p ${1} --authenticationDatabase 'admin' --ssl --host docker1 --sslCAFile ${MONGO_CA_CERT} --sslPEMKeyFile ${MONGO_PEM_CERT} --sslAllowInvalidCertificates +} \ No newline at end of file