fix: deploy_nvr.sh downloads go2rtc binary, sets correct config path
This commit is contained in:
parent
02ee23281c
commit
386d3b3858
1 changed files with 13 additions and 0 deletions
|
|
@ -184,6 +184,17 @@ export GOCACHE="$HOME/.cache/go-build"
|
||||||
# ── 3. Clone or update repository ──
|
# ── 3. Clone or update repository ──
|
||||||
log "Step 3/6: Fetching NextNVR source..."
|
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
|
if [ -d "${DEPLOY_DIR}/.git" ]; then
|
||||||
info "Repository exists, pulling latest..."
|
info "Repository exists, pulling latest..."
|
||||||
git -C "${DEPLOY_DIR}" pull origin main
|
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 mkdir -p "${STORAGE_PATH}"
|
||||||
sudo chown "$(whoami):$(id -gn)" "${STORAGE_PATH}"
|
sudo chown "$(whoami):$(id -gn)" "${STORAGE_PATH}"
|
||||||
sed -i "s|recordings_path:.*|recordings_path: \"${STORAGE_PATH}\"|" "${DEPLOY_DIR}/config.yaml"
|
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}"
|
log "Storage: ${STORAGE_PATH}"
|
||||||
else
|
else
|
||||||
log "Storage: ${CURRENT_PATH}"
|
log "Storage: ${CURRENT_PATH}"
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue