mirror of
https://github.com/tiredofit/docker-db-backup.git
synced 2025-12-21 13:23:12 +01:00
Merge pull request #258 from thomas-negrault/fix/mongo-restore-authentication-database
Use authentification database in mongorestore
This commit is contained in:
@@ -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=$?
|
||||
;;
|
||||
* )
|
||||
|
||||
Reference in New Issue
Block a user