Adding and removing mongodb databases from the apps list
This commit is contained in:
parent
7c06684656
commit
33de19cd99
|
@ -141,6 +141,11 @@ function drop_database_mongodb {
|
|||
return
|
||||
fi
|
||||
mongo $database_name --eval "db.runCommand( { dropDatabase: 1 } )"
|
||||
if [ $app_name ]; then
|
||||
if grep -q "$app_name" $MONGODB_APPS_FILE; then
|
||||
sed -i "/$app_name/d" $MONGODB_APPS_FILE
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
function initialise_database_mongodb {
|
||||
|
@ -157,4 +162,9 @@ function create_database_mongodb {
|
|||
app_admin_password="$2"
|
||||
app_admin_username=$3
|
||||
mongo admin --eval "db.createUser({user: '$app_admin_username', pwd: '$app_admin_password', roles: [ { role: 'userAdminAnyDatabase', db: 'admin' } ] })"
|
||||
if [ $app_name ]; then
|
||||
if ! grep -q "$app_name" $MONGODB_APPS_FILE; then
|
||||
echo "$app_name" >> $MONGODB_APPS_FILE
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue