From 784629f11b8da85c34f828ee67283c5d44cdb2ec Mon Sep 17 00:00:00 2001 From: Mr Chen Date: Sat, 21 Dec 2024 00:17:28 +0800 Subject: [PATCH] Update cli.sh --- cli.sh | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/cli.sh b/cli.sh index fc9ef386f1..9c9d890151 100755 --- a/cli.sh +++ b/cli.sh @@ -82,17 +82,26 @@ mw_start_bgtask(){ mw_stop() { - PLIST=`ps -ef|grep app:app |grep -v grep|awk '{print $2}'` - for i in $PLIST + APP_LIST=`ps -ef|grep app:app |grep -v grep|awk '{print $2}'` + APP_LIST=($APP_LIST) + for p in ${APP_LIST[@]} do - kill -9 $i > /dev/null 2>&1 + kill -9 $p > /dev/null 2>&1 done - PIDS=`ps -ef|grep panel_task.py | grep -v grep |awk '{print $2}'` - for p in $PIDS + TASK_LIST=`ps -ef|grep panel_task.py | grep -v grep |awk '{print $2}'` + TASK_LIST=($TASK_LIST) + for p in ${TASK_LIST[@]} do kill -9 $p > /dev/null 2>&1 done + + zzpids=`ps -A -o stat,ppid,pid | grep -e '^[Zz]' | awk '{print $2}'` + zzpids=($zzpids) + for p in ${zzpids[@]} + do + kill -9 ${p} > /dev/null 2>&1 + done } case "$1" in