fix: Use pgrep -x for exact process matching in mitmproxy RPCD

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
CyberMind-FR 2026-01-10 15:30:16 +01:00
parent c457da5632
commit f8c20a6c87

View File

@ -25,14 +25,18 @@ get_status() {
local mode="unknown"
local web_url=""
if pgrep mitmweb >/dev/null 2>&1; then
if pgrep -x mitmweb >/dev/null 2>&1; then
running=1
pid=$(pgrep mitmweb | head -1)
pid=$(pgrep -x mitmweb | head -1)
mode="mitmweb"
elif pgrep mitmdump >/dev/null 2>&1; then
elif pgrep -x mitmdump >/dev/null 2>&1; then
running=1
pid=$(pgrep mitmdump | head -1)
pid=$(pgrep -x mitmdump | head -1)
mode="mitmdump"
elif pgrep -f "python.*mitmproxy" >/dev/null 2>&1; then
running=1
pid=$(pgrep -f "python.*mitmproxy" | head -1)
mode="mitmproxy"
fi
local enabled=$(uci -q get mitmproxy.main.enabled || echo "0")