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:
parent
c457da5632
commit
f8c20a6c87
@ -25,14 +25,18 @@ get_status() {
|
|||||||
local mode="unknown"
|
local mode="unknown"
|
||||||
local web_url=""
|
local web_url=""
|
||||||
|
|
||||||
if pgrep mitmweb >/dev/null 2>&1; then
|
if pgrep -x mitmweb >/dev/null 2>&1; then
|
||||||
running=1
|
running=1
|
||||||
pid=$(pgrep mitmweb | head -1)
|
pid=$(pgrep -x mitmweb | head -1)
|
||||||
mode="mitmweb"
|
mode="mitmweb"
|
||||||
elif pgrep mitmdump >/dev/null 2>&1; then
|
elif pgrep -x mitmdump >/dev/null 2>&1; then
|
||||||
running=1
|
running=1
|
||||||
pid=$(pgrep mitmdump | head -1)
|
pid=$(pgrep -x mitmdump | head -1)
|
||||||
mode="mitmdump"
|
mode="mitmdump"
|
||||||
|
elif pgrep -f "python.*mitmproxy" >/dev/null 2>&1; then
|
||||||
|
running=1
|
||||||
|
pid=$(pgrep -f "python.*mitmproxy" | head -1)
|
||||||
|
mode="mitmproxy"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
local enabled=$(uci -q get mitmproxy.main.enabled || echo "0")
|
local enabled=$(uci -q get mitmproxy.main.enabled || echo "0")
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user