From 46f9c4e182293c217de730ae07e8219e83e06987 Mon Sep 17 00:00:00 2001 From: DarkLii Date: Wed, 23 Oct 2024 10:16:56 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E8=BF=9B=E7=A8=8B=E5=8F=B7=E5=A4=AA?= =?UTF-8?q?=E9=95=BF=E6=97=A0=E6=B3=95=E6=9D=80=E6=8E=89=E8=BF=9B=E7=A8=8B?= =?UTF-8?q?=EF=BC=8C=E5=AE=8C=E5=96=84kill=5Fprocess=E6=96=B9=E6=B3=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Description: --- src/cmdctl.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/cmdctl.py b/src/cmdctl.py index 4882c1d8..cbe74e1b 100644 --- a/src/cmdctl.py +++ b/src/cmdctl.py @@ -271,7 +271,7 @@ def kill_process(cls, process, grep_list: [list, tuple] = None): cmd = "" for i in cls.GREP_LIST: cmd += f"grep -v {i} | " - os.system(f"ps -ef | grep {process} | {cmd}cut -c 9-15 | xargs kill -9 > /dev/null 2>&1") + os.system(f"ps -ef | grep {process} | {cmd}awk '{{print $2}}' | xargs kill -9 > /dev/null 2>&1") @classmethod def sudo_kill_process(cls, process, grep_list: [list, tuple] = None):