#!/bin/bash set -e echo "Setting up Redis for TaaS Platform..." # Check if Redis is installed if ! command -v redis-cli &> /dev/null; then echo "Redis CLI not found. Please install Redis first." echo "Ubuntu/Debian: sudo apt-get install redis-server" echo "macOS: brew install redis" exit 1 fi # Redis connection details REDIS_HOST=${REDIS_HOST:-"localhost"} REDIS_PORT=${REDIS_PORT:-"6379"} echo "Testing Redis connection..." # Test connection if redis-cli -h $REDIS_HOST -p $REDIS_PORT ping > /dev/null 2>&1; then echo "✓ Redis is running and accessible" else echo "✗ Cannot connect to Redis at $REDIS_HOST:$REDIS_PORT" echo "Please start Redis: sudo systemctl start redis-server" exit 1 fi # Configure Redis for TaaS echo "Configuring Redis..." redis-cli -h $REDIS_HOST -p $REDIS_PORT <