Skip to content

Commit

Permalink
Merge pull request #258 from thomas-negrault/fix/mongo-restore-authen…
Browse files Browse the repository at this point in the history
…tication-database

Use authentification database in mongorestore
  • Loading branch information
tiredofit authored Oct 11, 2023
2 parents ebcd4fc + a9037f9 commit 8d6e72e
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion install/usr/local/bin/restore
Original file line number Diff line number Diff line change
Expand Up @@ -925,7 +925,10 @@ case "${r_dbtype}" in
if [ -n "${r_dbpass}" ] ; then
mongo_pass="-p=${r_dbpass}"
fi
mongorestore ${mongo_compression} -d=${r_dbname} -h=${r_dbhost} --port=${r_dbport} ${mongo_user} ${mongo_pass} --archive=${r_filename}
if [ -n "${DB_AUTH}" ] ; then
mongo_auth_database="--authenticationDatabase=${DB_AUTH}"
fi
mongorestore ${mongo_compression} -d=${r_dbname} -h=${r_dbhost} --port=${r_dbport} ${mongo_user} ${mongo_pass} --archive=${r_filename} ${mongo_auth_database}
exit_code=$?
;;
* )
Expand Down

0 comments on commit 8d6e72e

Please sign in to comment.