Files
OmniSocketGo_streaming/host/OmniSocketGo_add_camera/scripts/dev/start-local-hub.sh
2026-08-09 15:56:20 +08:00

23 lines
788 B
Bash

#!/usr/bin/env bash
set -euo pipefail
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
# shellcheck disable=SC1091
source "${SCRIPT_DIR}/load-env.sh"
hub_binary="${OMNISOCKETGO_ROOT}/bin/kcpserver"
hub_listen_addr="${LOCAL_HUB_LISTEN_ADDR:-0.0.0.0:10909}"
telemetry_peer_id="${LOCAL_HUB_TELEMETRY_PEER_ID:-peer-a-telemetry}"
telemetry_interval="${LOCAL_HUB_TELEMETRY_INTERVAL:-1000ms}"
if [[ ! -x "${hub_binary}" ]]; then
echo "[start-local-hub] missing executable ${hub_binary}; run: make bin/kcpserver" >&2
exit 1
fi
echo "[start-local-hub] listen=${hub_listen_addr} relay=disabled telemetry_peer=${telemetry_peer_id}" >&2
exec "${hub_binary}" \
-listen "${hub_listen_addr}" \
-telemetry-peer "${telemetry_peer_id}" \
-telemetry-interval "${telemetry_interval}"