#!/bin/bash set -e echo "Setting up MongoDB for TaaS Platform..." # Check if MongoDB is installed if ! command -v mongosh &> /dev/null; then echo "MongoDB shell (mongosh) not found. Please install MongoDB first." echo "Visit: https://www.mongodb.com/docs/manual/installation/" exit 1 fi # MongoDB connection details MONGO_HOST=${MONGO_HOST:-"localhost"} MONGO_PORT=${MONGO_PORT:-"27017"} MONGO_USER=${MONGO_USER:-"free5gc"} MONGO_PASS=${MONGO_PASS:-"free5gc_password"} MONGO_DB="free5gc" echo "Creating MongoDB database and user..." # Create database and user mongosh --host $MONGO_HOST --port $MONGO_PORT <