-
Notifications
You must be signed in to change notification settings - Fork 2
/
stop.sh
44 lines (32 loc) · 942 Bytes
/
stop.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
# @author EricYonng<120453674@qq.com>
# @brief 3rd scripts
#!/usr/bin/env bash
# 路径
SCRIPT_PATH="$(cd $(dirname $0); pwd)"
# GREP_FLAG="CrystalNet"
# if [ $1 ]
# then
# echo "param 1:$1"
# GREP_FLAG=$1
# fi
# echo "will stop process with GREP_FLAG:${GREP_FLAG}"
# PID_LIST="$(ps -aux |grep ${GREP_FLAG} | sed '/grep/d' | sed '/stop/d' | sed 's/^[^ ]* //' | sed 's/^ *//' | sed 's/ .*$//')"
# echo "will stop PID_LIST:${PID_LIST}"
# for pid in $PID_LIST
# do
# echo "stop process $pid"
# kill 2 $pid
# done
# for pid in $PID_LIST
# do
# echo "wait pid:${pid} close..."
# while [ -n "$(ps -p $pid | sed '1d')" ]
# do
# echo "wait pid:${pid} close..."
# sleep 1
# done
# echo "pid:${pid}, has closed."
# done
# echo "all process has closed."
sudo chmod a+x $SCRIPT_PATH/tools/CloseProcess/CloseProcess
${SCRIPT_PATH}/tools/CloseProcess/CloseProcess testsuit is_waiting_close=1