在 run.sh 中优化容器状态检查逻辑;在 install.sh 中添加配置文件检查功能以验证 JSON 格式

This commit is contained in:
Olia Lisa
2026-01-11 11:55:59 +08:00
parent 4425a908f4
commit 9d1a13a140
2 changed files with 24 additions and 5 deletions
+1 -3
View File
@@ -24,12 +24,10 @@ run() {
bash "$script_dir/create_config.sh" # 创建配置
fi
# 检查容器是否已启动,如果启动则先关闭
# 如果容器已经启动, 则先停止容器
local compose_file="$script_dir/../docker-compose.yml"
if docker-compose -f "$compose_file" ps | grep -q "Up"; then
echo "检测到容器正在运行,正在关闭容器..."
docker-compose -f "$compose_file" down
echo "容器已关闭"
fi
# 启动docker容器