加入杀死进程的脚本
This commit is contained in:
parent
8bd97382f0
commit
00ebdf2e3d
@ -11,6 +11,7 @@ steps:
|
|||||||
- name: run
|
- name: run
|
||||||
commands:
|
commands:
|
||||||
- pip install -i https://mirrors.tuna.tsinghua.edu.cn/pypi/web/simple -r requirements.txt
|
- pip install -i https://mirrors.tuna.tsinghua.edu.cn/pypi/web/simple -r requirements.txt
|
||||||
- pkill chyoso_toolkit_ui.py
|
- chomd +x kill_ui.sh
|
||||||
|
- ./kill_ui.sh
|
||||||
- nohup python3 chyoso_toolkit_ui.py > output.log 2>&1 &
|
- nohup python3 chyoso_toolkit_ui.py > output.log 2>&1 &
|
||||||
...
|
...
|
||||||
14
kill_ui.sh
Normal file
14
kill_ui.sh
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
# 使用 pgrep 查找进程 ID
|
||||||
|
pid=$(pgrep -f chyoso_toolkit_ui.py)
|
||||||
|
|
||||||
|
# 检查 pgrep 的返回值
|
||||||
|
if [ $? -eq 0 ]; then
|
||||||
|
# 如果找到进程,使用 kill 终止进程
|
||||||
|
kill $pid
|
||||||
|
echo "成功终止进程"
|
||||||
|
else
|
||||||
|
# 如果没有找到进程,返回 0
|
||||||
|
echo "没有找到进程"
|
||||||
|
fi
|
||||||
Loading…
x
Reference in New Issue
Block a user