kindergarten_java/restart-frontend.sh

14 lines
353 B
Bash
Raw Normal View History

#!/bin/bash
# 查找并终止占用 5173 端口的进程
PORT=5173
PID=$(netstat -ano | grep ":$PORT" | grep LISTENING | awk '{print $NF}')
if [ ! -z "$PID" ]; then
echo "终止占用端口 $PORT 的进程 (PID: $PID)"
taskkill //F //PID $PID
fi
# 启动前端
echo "启动前端服务..."
cd lesingle-edu-reading-platform-frontend
npm run dev