已改成自动处理端口占用:start 发现 2333 被占用会先执行 do_stop,再重试;如果还占用才报错退出。
This commit is contained in:
10
run.sh
10
run.sh
@@ -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"
|
||||
|
||||
Reference in New Issue
Block a user