修改配置

This commit is contained in:
vet
2026-04-13 20:38:36 +07:00
parent 33a6dcfa1b
commit ad326b7500
2 changed files with 14 additions and 2 deletions

View File

@@ -20,6 +20,16 @@
set -euo pipefail
source "$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)/common.sh"
init_dirs
# 供文末打印访问地址set -u 下须已定义;与 01-init-env 中 DEPLOY_TEST_IP 一致)
if [[ -f "$ENV_FILE" ]]; then
set -a
# shellcheck source=/dev/null
source "$ENV_FILE"
set +a
fi
DEPLOY_TEST_IP="${DEPLOY_TEST_IP:-127.0.0.1}"
init_script_log # ← 脚本执行日志
header "启动前端开发服务器"

View File

@@ -185,7 +185,8 @@ start_svc() {
# ── 停止单个后端服务 ────────────────────────────────────────────────────────────
stop_svc() {
local name="$1" pidfile="$PID_DIR/$name.pid"
local name="$1"
local pidfile="$PID_DIR/$name.pid"
if [[ -f "$pidfile" ]]; then
local pid; pid=$(cat "$pidfile")
if kill -0 "$pid" 2>/dev/null; then
@@ -213,7 +214,8 @@ print_container_status() {
# ── 后端服务状态打印 ────────────────────────────────────────────────────────────
print_svc_status() {
local name="$1" desc="$2" pidfile="$PID_DIR/$name.pid"
local name="$1" desc="$2"
local pidfile="$PID_DIR/$name.pid"
if [[ -f "$pidfile" ]] && kill -0 "$(cat "$pidfile")" 2>/dev/null; then
printf " ${GREEN}${NC} %-18s PID=%-7s %s\n" "$name" "$(cat "$pidfile")" "$desc"
else