Files
dropshell-templates/squashkiwi-streaming/start.sh
Your Name f1b107748a
All checks were successful
Test and Publish Templates / test-and-publish (push) Successful in 22s
config: Update 5 files
2025-09-01 22:14:11 +12:00

37 lines
1.3 KiB
Bash
Executable File

#!/bin/bash
# shellcheck disable=SC1091
source "${AGENT_PATH}/common.sh"
_check_required_env_vars "PROJECT_NAME" "LOCAL_DATA_FOLDER"
cd "${LOCAL_DATA_FOLDER}/config" || _die "Failed to change to config directory"
# Check that .env file exists and show configuration
if [[ ! -f "${LOCAL_DATA_FOLDER}/config/.env" ]]; then
_die ".env file not found at ${LOCAL_DATA_FOLDER}/config/.env - run install first"
fi
echo "Checking .env configuration..."
CONFIGURED_IP=$(grep "MTX_PATHS_COURT_MAIN_SOURCE" "${LOCAL_DATA_FOLDER}/config/.env" | sed -n 's/.*@\([0-9.]*\):.*/\1/p')
echo "Camera IP from .env: ${CONFIGURED_IP}"
echo "Camera IP from service.env: ${CAMERA_IP}"
# Start docker compose services (docker-compose will read .env file created by install.sh)
echo "Starting ${PROJECT_NAME} services..."
docker compose up -d || _die "Failed to start Docker Compose services"
# Wait for services to be healthy
echo "Waiting for services to be healthy..."
sleep 5
# Check service health
if docker compose ps | grep -q "healthy"; then
echo "✓ Services are healthy"
else
echo "⚠ Some services may not be healthy yet. Check with: docker compose ps"
fi
echo ""
echo "${PROJECT_NAME} started successfully!"
echo "Stream URL: http://$(hostname -I | awk '{print $1}'):${HOST_PORT}"
echo "View logs: docker compose logs -f"