
All checks were successful
Test and Publish Templates / test-and-publish (push) Successful in 21s
43 lines
1.6 KiB
Bash
Executable File
43 lines
1.6 KiB
Bash
Executable File
#!/bin/bash
|
|
# shellcheck disable=SC1091
|
|
source "${AGENT_PATH}/common.sh"
|
|
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
|
source "${SCRIPT_DIR}/_paths.sh"
|
|
_check_required_env_vars "PROJECT_NAME" "LOCAL_DATA_FOLDER" "CAMERA_IP" "COURT_ID" "RECORDINGS_FOLDER"
|
|
|
|
# Create directories
|
|
# shellcheck disable=SC2046
|
|
create_items $(get_squashkiwi_streaming_paths) || _die "Failed to create directories"
|
|
mkdir -p "${RECORDINGS_FOLDER}"
|
|
|
|
# Copy configuration files
|
|
cp -r "${SCRIPT_DIR}/config/"* "${LOCAL_DATA_FOLDER}/config/" || _die "Failed to copy config files"
|
|
|
|
# Test Docker
|
|
_check_docker_installed || _die "Docker test failed, aborting installation..."
|
|
|
|
# Test camera connection (optional check)
|
|
echo "Testing camera connection to ${CAMERA_IP}..."
|
|
if ping -c 1 -W 2 "${CAMERA_IP}" > /dev/null 2>&1; then
|
|
echo "✓ Camera IP is reachable"
|
|
else
|
|
echo "⚠ Warning: Camera IP ${CAMERA_IP} is not reachable. Please check camera connection."
|
|
fi
|
|
|
|
# Build overlay service
|
|
cd "${LOCAL_DATA_FOLDER}/config" || _die "Failed to change to config directory"
|
|
docker compose build overlay-service || _die "Failed to build overlay service"
|
|
|
|
# Stop any existing containers
|
|
bash "${SCRIPT_DIR}/stop.sh" 2>/dev/null || true
|
|
|
|
# Start services
|
|
bash "${SCRIPT_DIR}/start.sh" || _die "Failed to start services"
|
|
|
|
echo ""
|
|
echo "Installation of ${PROJECT_NAME} complete!"
|
|
echo "Access the stream at: http://$(hostname -I | awk '{print $1}'):${HOST_PORT}"
|
|
echo ""
|
|
echo "To enable optional features:"
|
|
echo " - Cloudflare tunnel: Set CLOUDFLARE_TUNNEL_TOKEN in service.env and run: docker compose --profile tunnel up -d"
|
|
echo " - Monitoring: docker compose --profile monitoring up -d" |