fix: pkill patterns — target binary paths, not script itself
This commit is contained in:
parent
31ea59ceea
commit
7b9902f788
2 changed files with 8 additions and 8 deletions
|
|
@ -42,12 +42,12 @@ fi
|
||||||
# ── 1. Kill all existing instances ──
|
# ── 1. Kill all existing instances ──
|
||||||
log "Stopping any running NextNVR instances..."
|
log "Stopping any running NextNVR instances..."
|
||||||
sudo systemctl stop "${SERVICE_NAME}" 2>/dev/null || true
|
sudo systemctl stop "${SERVICE_NAME}" 2>/dev/null || true
|
||||||
sudo pkill -9 -f "nextnvr" 2>/dev/null || true
|
sudo pkill -9 -f "/opt/nextnvr/nextnvr" 2>/dev/null || true
|
||||||
sudo pkill -9 -f "go2rtc" 2>/dev/null || true
|
sudo pkill -9 -f "go2rtc -config" 2>/dev/null || true
|
||||||
sudo pkill -9 -f "ffmpeg.*rec_" 2>/dev/null || true
|
sudo pkill -9 -f "ffmpeg.*-i rtsp" 2>/dev/null || true
|
||||||
sleep 2
|
sleep 2
|
||||||
|
|
||||||
if pgrep -f "nextnvr" > /dev/null 2>&1; then
|
if pgrep -f "/opt/nextnvr/nextnvr" > /dev/null 2>&1; then
|
||||||
err "Cannot kill existing NextNVR processes. Please stop them manually and retry."
|
err "Cannot kill existing NextNVR processes. Please stop them manually and retry."
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
|
||||||
|
|
@ -14,11 +14,11 @@ echo "Stopping service..."
|
||||||
sudo systemctl stop "${SERVICE_NAME}" 2>/dev/null || true
|
sudo systemctl stop "${SERVICE_NAME}" 2>/dev/null || true
|
||||||
sudo systemctl disable "${SERVICE_NAME}" 2>/dev/null || true
|
sudo systemctl disable "${SERVICE_NAME}" 2>/dev/null || true
|
||||||
|
|
||||||
# Kill any lingering processes.
|
# Kill any lingering processes (target only NextNVR binaries, not the script).
|
||||||
echo "Killing processes..."
|
echo "Killing processes..."
|
||||||
sudo pkill -9 -f "nextnvr" 2>/dev/null || true
|
sudo pkill -9 -f "/opt/nextnvr/nextnvr" 2>/dev/null || true
|
||||||
sudo pkill -9 -f "go2rtc" 2>/dev/null || true
|
sudo pkill -9 -f "go2rtc -config" 2>/dev/null || true
|
||||||
sudo pkill -9 -f "ffmpeg.*rec_" 2>/dev/null || true
|
sudo pkill -9 -f "ffmpeg.*-i rtsp" 2>/dev/null || true
|
||||||
sleep 1
|
sleep 1
|
||||||
|
|
||||||
# Remove systemd service file.
|
# Remove systemd service file.
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue