From 3ef5c64c30ed6114331e108d35987f993524a97e Mon Sep 17 00:00:00 2001 From: Olia Lisa Date: Sat, 10 Jan 2026 19:43:16 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- install.sh | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/install.sh b/install.sh index fbca21b..7d04b2a 100644 --- a/install.sh +++ b/install.sh @@ -1,11 +1,17 @@ #!/bin/bash -restart_docker(){ - # 如果docker容器没有启动, 则退出 +restart_docker() { local running_count=$(docker-compose -f ./docker-compose.yml ps -q | wc -l) if [ "$running_count" -eq 0 ]; then - echo "容器未启动, 无需重启" - return + read -p "容器未启动,是否启动容器?(Y/N): " choice + case "$choice" in + Y|y) + ;; + *) + echo "已取消启动" + return + ;; + esac fi echo "正在重启容器..." @@ -13,7 +19,6 @@ restart_docker(){ docker-compose -f ./docker-compose.yml up -d } - check_config(){ local config_dir="./conf" # 如果配置文件不存在或者空白