docs: Add 42 files
All checks were successful
Test and Publish Templates / test-and-publish (push) Successful in 59s
All checks were successful
Test and Publish Templates / test-and-publish (push) Successful in 59s
This commit is contained in:
45
squashkiwi-streaming/install.sh
Executable file
45
squashkiwi-streaming/install.sh
Executable file
@@ -0,0 +1,45 @@
|
||||
#!/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"
|
||||
|
||||
# Create directories
|
||||
# shellcheck disable=SC2046
|
||||
create_items $(get_squashkiwi_streaming_paths) || _die "Failed to create directories"
|
||||
|
||||
# Copy configuration files
|
||||
cp -r "${SCRIPT_DIR}/config/"* "${LOCAL_DATA_FOLDER}/config/" || _die "Failed to copy config files"
|
||||
|
||||
# Update recordings path in service.env
|
||||
sed -i "s|RECORDINGS_PATH=.*|RECORDINGS_PATH=${LOCAL_DATA_FOLDER}/recordings|" "${LOCAL_DATA_FOLDER}/config/service.env"
|
||||
|
||||
# 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"
|
Reference in New Issue
Block a user