feat: deploy_nvr.sh — stops service before rebuild, update instructions
This commit is contained in:
parent
7c7c920f5e
commit
aba58cf1a0
2 changed files with 27 additions and 7 deletions
14
README.md
14
README.md
|
|
@ -8,7 +8,7 @@ A simple, single-binary IP camera recorder. Think of it as a dashcam for your pr
|
|||
|
||||
The open-source NVR landscape is rich with incredible projects — Frigate, Shinobi, ZoneMinder, Blue Iris alternatives — backed by passionate communities. They're powerful. They're feature-packed. But they've also become complex. Docker containers, AI pipelines, multi-service architectures, cloud integrations — for many users, it's too much.
|
||||
|
||||
**NextNVR is different.** It does one thing: continuously record your IP cameras to disk and let you review the footage. No AI, no cloud, no Docker — just a single Go binary you can run on a Raspberry Pi 5, an old thin client, or a VM. Deploy it in 30 seconds with a one-liner.
|
||||
**NextNVR is different.** It does one thing: continuously record your IP cameras to disk and let you review the footage. No AI, no cloud, no Docker — just a single Go binary you can run on a Raspberry Pi 5, an old thin client, or a VM. Deploy in 30 seconds — download, run, done.
|
||||
|
||||
This project was built with the help of AI — designed through conversation, refined through iteration, and shaped by the simple principle that surveillance software should be boring. It should just work.
|
||||
|
||||
|
|
@ -17,15 +17,19 @@ This project was built with the help of AI — designed through conversation, re
|
|||
## Quick Install
|
||||
|
||||
```bash
|
||||
curl -sSL https://git.lohmar.co.uk/cclohmar/NextNVR/raw/branch/main/setup.sh | bash
|
||||
curl -sSLO https://git.lohmar.co.uk/cclohmar/NextNVR/raw/branch/main/deploy_nvr.sh
|
||||
chmod +x deploy_nvr.sh
|
||||
./deploy_nvr.sh
|
||||
```
|
||||
|
||||
The script will ask where to store recordings. Press Enter for the default (`~/nvr_data`) or type your own path (e.g. `/mnt/recordings`).
|
||||
The script asks where to store recordings, then installs everything. Press Enter for the default (`~/nvr_data`) or type your own path.
|
||||
|
||||
**Want to pre-set the storage path without being asked?**
|
||||
**To update an existing installation** — run the same script again. It stops the service, pulls the latest code, rebuilds, and restarts.
|
||||
|
||||
**To pre-set the storage path:**
|
||||
|
||||
```bash
|
||||
STORAGE_PATH=/mnt/recordings curl -sSL https://...setup.sh | bash
|
||||
STORAGE_PATH=/mnt/recordings ./deploy_nvr.sh
|
||||
```
|
||||
|
||||
---
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
#!/bin/bash
|
||||
# NextNVR — Portable One-Line Deployment Script
|
||||
# Usage: curl -sSL https://git.lohmar.co.uk/cclohmar/NextNVR/raw/branch/main/setup.sh | bash
|
||||
# NextNVR — Deploy & Update Script
|
||||
# Usage: curl -sSLO https://git.lohmar.co.uk/cclohmar/NextNVR/raw/branch/main/deploy_nvr.sh
|
||||
# chmod +x deploy_nvr.sh && ./deploy_nvr.sh
|
||||
#
|
||||
# Supports: Debian, Ubuntu, Fedora, RHEL, Rocky, Alma, Arch, Alpine
|
||||
# Requires: curl, sudo, systemd (or falls back to nohup for non-systemd)
|
||||
|
|
@ -33,6 +34,21 @@ echo " $(uname -m) / $(uname -s)"
|
|||
echo "============================================"
|
||||
echo ""
|
||||
|
||||
# ── 0. Stop existing service (clean update) ──
|
||||
if systemctl is-active --quiet "${SERVICE_NAME}" 2>/dev/null; then
|
||||
log "Stopping existing NextNVR service..."
|
||||
sudo systemctl stop "${SERVICE_NAME}"
|
||||
log "Service stopped."
|
||||
elif pgrep -f "/opt/nextnvr/nextnvr" > /dev/null 2>&1; then
|
||||
warn "NextNVR is running outside systemd. Stopping..."
|
||||
sudo pkill -f "/opt/nextnvr/nextnvr" 2>/dev/null || true
|
||||
sleep 2
|
||||
fi
|
||||
|
||||
# Clean up any lingering processes.
|
||||
sudo pkill -f "go2rtc" 2>/dev/null || true
|
||||
sudo pkill -f "ffmpeg.*rec_" 2>/dev/null || true
|
||||
|
||||
# ── Check for sudo ──
|
||||
if ! command -v sudo &>/dev/null; then
|
||||
if [ "$(id -u)" -eq 0 ]; then
|
||||
Loading…
Reference in a new issue