855 协议版本-调整完毕内容
This commit is contained in:
20
restart.sh
Normal file
20
restart.sh
Normal file
@@ -0,0 +1,20 @@
|
||||
#!/bin/bash
|
||||
|
||||
# 进入项目目录
|
||||
cd /home/liuwei/wechatbot/WeChatRobot
|
||||
|
||||
# 拉取最新代码
|
||||
git pull origin feature-855 # 根据需要拉取对应的分支
|
||||
|
||||
# 查找并杀死当前 main.py 进程
|
||||
CURRENT_PID=$(ps aux | grep 'main.py' | grep -v grep | awk '{print $2}')
|
||||
if [ -n "$CURRENT_PID" ]; then
|
||||
echo "Killing the existing main.py process (PID: $CURRENT_PID)"
|
||||
kill -9 $CURRENT_PID
|
||||
else
|
||||
echo "No running main.py process found."
|
||||
fi
|
||||
|
||||
# 重新启动 main.py
|
||||
echo "Restarting main.py..."
|
||||
python main.py &
|
||||
Reference in New Issue
Block a user