修改配置
This commit is contained in:
@@ -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 "启动前端开发服务器"
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user