diff --git a/bin/ ZeroWrt.backup b/bin/ ZeroWrt.backup index 214201f..d324b87 100644 --- a/bin/ ZeroWrt.backup +++ b/bin/ ZeroWrt.backup @@ -329,7 +329,8 @@ install_apps() { color_output "\e[36m┃\e[0m 1. 部署 ShellClash \e[36m┃\e[0m" color_output "\e[36m┃\e[0m 2. 部署 小雅 Alist \e[36m┃\e[0m" color_output "\e[36m┃\e[0m 3. 部署 Subconverter \e[36m┃\e[0m" - color_output "\e[36m┃\e[0m 4. 部署 AdGuardhome \e[36m┃\e[0m" + color_output "\e[36m┃\e[0m 4. 部署 AdGuardhome \e[36m┃\e[0m" + color_output "\e[36m┃\e[0m 5. 部署 Gitea-MySQL \e[36m┃\e[0m" color_output "\e[36m┃\e[0m 0. 返回主菜单 \e[36m┃\e[0m" color_output "\e[36m┃ ┃\e[0m" color_output "\e[36m┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛\e[0m" @@ -471,7 +472,46 @@ install_apps() { fi fi read -p "按 Enter 键返回..." - ;; + ;; + 5) + color_output "\e[34m[部署 Gitea-MySQL]\e[0m" + + # 检查 Gitea 容器是否已存在 + if docker ps -a | grep -q "gitea"; then + color_output "\e[33mGitea-MySQL 已经部署过,跳过部署!\e[0m" + read -p "按 Enter 键返回..." + continue + fi + + color_output "\e[33m正在部署 Gitea 和 MySQL...\e[0m" + + # 创建目录 + mkdir -p /opt/Gitea + mkdir -p /opt/MySQL + + # 下载 Docker Compose 文件到 /opt/gitea + curl -L https://raw.githubusercontent.com/your/repository/path/to/docker-compose.yml -o /opt/Gitea/docker-compose.yml + + # 检查是否下载成功 + if [ -f "/opt/Gitea/docker-compose.yml" ]; then + color_output "\e[32mDocker Compose 文件下载成功!\e[0m" + else + color_output "\e[31mDocker Compose 文件下载失败!\e[0m" + read -p "按 Enter 键返回..." + continue + fi + + # 部署 Gitea 和 MySQL + cd /opt/Gitea + docker-compose up -d + + if docker ps | grep -q "gitea"; then + color_output "\e[32mGitea-MySQL 部署成功!\e[0m" + else + color_output "\e[31mGitea-MySQL 部署失败!\e[0m" + fi + read -p "按 Enter 键返回..." + ;; 0) show_menu return