From c91492b84c5ef99c1a66b4962166a09200d14032 Mon Sep 17 00:00:00 2001 From: Olia Lisa Date: Tue, 19 May 2026 18:37:47 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E7=8A=B6=E6=80=81=E6=A3=80?= =?UTF-8?q?=E6=9F=A5=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- install.sh | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/install.sh b/install.sh index 34d0337..d1e6bbc 100644 --- a/install.sh +++ b/install.sh @@ -30,8 +30,25 @@ install(){ } +# 检查singbox容器运行状态 +check_container_status(){ + # local script_dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" + local compose_file="$./docker-compose.yml" + + local status + status=$(docker compose -f "$compose_file" ps --status running --quiet 2>/dev/null) + + if [ -n "$status" ]; then + echo "运行中" + else + echo "未运行" + fi +} + main(){ # 显示菜单 + echo 运行状态: $(check_container_status) + echo "==============================" echo "请选择一个操作:" echo "1. 一键部署" echo "2. 生成配置 / 重置配置"