diff --git a/install.sh b/install.sh index 4068fc2..3c3fd4b 100644 --- a/install.sh +++ b/install.sh @@ -49,9 +49,10 @@ check_container_status(){ } main(){ + local container_status=$(check_container_status) # 显示菜单 echo "" - echo 运行状态: $(check_container_status) + echo 运行状态: $container_status echo "==============================" echo "请选择一个操作:" echo "1. 一键部署" @@ -96,6 +97,10 @@ main(){ ;; 5) # 停止 + if echo "$container_status" | grep -q "未运行"; then + echo "程序已停止" + return + fi docker compose -f ./docker-compose.yml down ;; 6)