已改成自动处理端口占用:start 发现 2333 被占用会先执行 do_stop,再重试;如果还占用才报错退出。
Some checks failed
CI / lint (push) Has been cancelled
CI / build (push) Has been cancelled

This commit is contained in:
2026-02-27 10:58:11 +08:00
parent 0e74c56caf
commit ee871021ef

10
run.sh
View File

@@ -41,8 +41,14 @@ function do_start() {
PORT_PID=$(lsof -t -i:2333)
if [ -n "$PORT_PID" ]; then
printf "${RED}错误: 端口 2333 已被占用尝试执<E8AF95><E689A7>?stop 后再启动${NC}\n"
return 1
printf "${YELLOW}?? 2333 ??????????????...${NC}\n"
do_stop
sleep 1
PORT_PID=$(lsof -t -i:2333)
if [ -n "$PORT_PID" ]; then
printf "${RED}??: ?? 2333 ?????????????????${NC}\n"
return 1
fi
fi
printf "${GREEN}?? $PM ?? STARK Todo List (production)...${NC}\n"