test
This commit is contained in:
@@ -28,6 +28,7 @@ declare -A FE_PORT_NUM=(
|
||||
_stop_fe() {
|
||||
local name="$1"
|
||||
local pidfile="$PID_DIR/fe-${name}.pid"
|
||||
local port="${FE_PORT_NUM[$name]}"
|
||||
if [[ -f "$pidfile" ]]; then
|
||||
local pid; pid=$(cat "$pidfile")
|
||||
if kill -0 "$pid" 2>/dev/null; then
|
||||
@@ -37,13 +38,13 @@ _stop_fe() {
|
||||
if kill -0 "$pid" 2>/dev/null; then
|
||||
_kill_tree "$pid" KILL
|
||||
fi
|
||||
success "$name 已停止 (PID=$pid)"
|
||||
success "$name 已停止 (端口=$port, PID=$pid)"
|
||||
else
|
||||
warn "$name 进程不存在(可能已退出)"
|
||||
warn "$name 进程不存在(端口=$port,可能已退出)"
|
||||
fi
|
||||
rm -f "$pidfile"
|
||||
else
|
||||
warn "$name 没有 PID 记录(未运行)"
|
||||
warn "$name 没有 PID 记录(端口=$port,未运行)"
|
||||
fi
|
||||
|
||||
_stop_fe_port "$name"
|
||||
|
||||
Reference in New Issue
Block a user