diff --git a/deploy_nvr.sh b/deploy_nvr.sh index 1b5f4b7..246ad7d 100755 --- a/deploy_nvr.sh +++ b/deploy_nvr.sh @@ -184,6 +184,17 @@ export GOCACHE="$HOME/.cache/go-build" # ── 3. Clone or update repository ── log "Step 3/6: Fetching NextNVR source..." +# Download go2rtc (required for live streaming and snapshots). +GO2RTC_VER="1.9.14" +GO2RTC_BIN="${DEPLOY_DIR}/go2rtc" +if [ ! -f "${GO2RTC_BIN}" ]; then + info "Downloading go2rtc ${GO2RTC_VER}..." + sudo mkdir -p "${DEPLOY_DIR}" 2>/dev/null || true + curl -sSL "https://github.com/AlexxIT/go2rtc/releases/download/v${GO2RTC_VER}/go2rtc_linux_${GO_ARCH}" -o "${GO2RTC_BIN}" + chmod +x "${GO2RTC_BIN}" + log "go2rtc installed." +fi + if [ -d "${DEPLOY_DIR}/.git" ]; then info "Repository exists, pulling latest..." git -C "${DEPLOY_DIR}" pull origin main @@ -230,6 +241,8 @@ if [ -z "${CURRENT_PATH}" ] || [ "${CURRENT_PATH}" = "/home/master/nvr_data" ]; sudo mkdir -p "${STORAGE_PATH}" sudo chown "$(whoami):$(id -gn)" "${STORAGE_PATH}" sed -i "s|recordings_path:.*|recordings_path: \"${STORAGE_PATH}\"|" "${DEPLOY_DIR}/config.yaml" + # Set go2rtc binary path. + sed -i "s|binary:.*|binary: \"${GO2RTC_BIN}\"|" "${DEPLOY_DIR}/config.yaml" log "Storage: ${STORAGE_PATH}" else log "Storage: ${CURRENT_PATH}"