You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

28 lines
690 B

#!/bin/bash
# 停止所有服务脚本
echo "正在停止所有聊天服务器..."
# 停止WebSocket服务器
WEB_PIDS=$(ps aux | grep "server.WebSocketServer" | grep -v grep | awk '{print $2}')
if [ ! -z "$WEB_PIDS" ]; then
echo "停止Web服务器..."
kill -9 $WEB_PIDS 2>/dev/null
echo "✓ Web服务器已停止"
else
echo "Web服务器未运行"
fi
# 停止TCP服务器
TCP_PIDS=$(ps aux | grep "server.ChatServer" | grep -v grep | awk '{print $2}')
if [ ! -z "$TCP_PIDS" ]; then
echo "停止TCP服务器..."
kill -9 $TCP_PIDS 2>/dev/null
echo "✓ TCP服务器已停止"
else
echo "TCP服务器未运行"
fi
echo ""
echo "所有服务器已停止"