From f8c20a6c87d176eff2ef97f518cf8e8fbba1197a Mon Sep 17 00:00:00 2001 From: CyberMind-FR Date: Sat, 10 Jan 2026 15:30:16 +0100 Subject: [PATCH] fix: Use pgrep -x for exact process matching in mitmproxy RPCD Co-Authored-By: Claude Opus 4.5 --- .../root/usr/libexec/rpcd/luci.mitmproxy | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/package/secubox/luci-app-mitmproxy/root/usr/libexec/rpcd/luci.mitmproxy b/package/secubox/luci-app-mitmproxy/root/usr/libexec/rpcd/luci.mitmproxy index ef62920e..f1524aa9 100755 --- a/package/secubox/luci-app-mitmproxy/root/usr/libexec/rpcd/luci.mitmproxy +++ b/package/secubox/luci-app-mitmproxy/root/usr/libexec/rpcd/luci.mitmproxy @@ -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")