This commit is contained in:
2026-05-18 23:03:40 +08:00
parent 3542990072
commit 23df7b415f
2 changed files with 20 additions and 17 deletions

View File

@@ -1,7 +1,7 @@
#!/usr/bin/env sh
set -eu
# Validate config, then reload OpenResty after conf changes.
# 修改配置后先校验,再重载 OpenResty。
ROOT_DIR="$(CDPATH= cd -- "$(dirname -- "$0")" && pwd)"
@@ -9,18 +9,18 @@ cd "$ROOT_DIR"
. "$ROOT_DIR/scripts/lib-compose.sh"
echo "Validating Docker Compose configuration..."
echo "正在校验 Docker Compose 配置..."
compose config >/dev/null
echo "Validating OpenResty configuration..."
echo "正在校验 OpenResty 配置..."
compose exec -T openresty openresty -t
echo "Reloading OpenResty..."
echo "正在重载 OpenResty..."
if compose exec -T openresty openresty -s reload; then
echo "OpenResty reloaded."
echo "OpenResty 已重载。"
else
echo "Reload failed; restarting OpenResty..."
echo "重载失败,正在重启 OpenResty..."
compose restart openresty
fi
echo "Done."
echo "完成。"