14 lines
307 B
Bash
14 lines
307 B
Bash
#!/bin/bash
|
|
|
|
# 使用 pgrep 查找进程 ID
|
|
pid=$(pgrep -f chyoso_toolkit_ui.py)
|
|
|
|
# 检查 pgrep 的返回值
|
|
if [ $? -eq 0 ]; then
|
|
# 如果找到进程,使用 kill 终止进程
|
|
kill $pid
|
|
echo "成功终止进程"
|
|
else
|
|
# 如果没有找到进程,返回 0
|
|
echo "没有找到进程"
|
|
fi |