mirror of
https://github.com/openimsdk/open-im-server.git
synced 2026-05-06 18:15:59 +08:00
remove \r
This commit is contained in:
@@ -11,6 +11,7 @@
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
mongosh <<EOF
|
||||
use admin
|
||||
var rootUsername = '$MONGO_INITDB_ROOT_USERNAME';
|
||||
@@ -22,6 +23,7 @@ if (authResult) {
|
||||
print('Authentication failed for root user: ' + rootUsername + ' with password: ' + rootPassword);
|
||||
quit(1);
|
||||
}
|
||||
|
||||
var dbName = '$MONGO_INITDB_DATABASE';
|
||||
db = db.getSiblingDB(dbName);
|
||||
var openimUsername = '$MONGO_OPENIM_USERNAME';
|
||||
@@ -33,6 +35,7 @@ var createUserResult = db.createUser({
|
||||
{ role: 'readWrite', db: dbName }
|
||||
]
|
||||
});
|
||||
|
||||
if (createUserResult.ok == 1) {
|
||||
print('User creation successful. User: ' + openimUsername + ', Database: ' + dbName);
|
||||
} else {
|
||||
@@ -40,3 +43,6 @@ if (createUserResult.ok == 1) {
|
||||
quit(1);
|
||||
}
|
||||
EOF
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user