更新 bin/ZeroWrt

Signed-off-by: zhao <zhao@noreply.localhost>
This commit is contained in:
zhao 2025-01-24 02:03:02 +08:00
parent b185fb95f0
commit 048aef0bf5

View File

@ -330,6 +330,8 @@ install_apps() {
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 5. 部署 Gitea-MySQL \e[36m┃\e[0m"
color_output "\e[36m┃\e[0m 6. 部署 SunPanel导航页 \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"
@ -472,6 +474,85 @@ install_apps() {
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://git.kejizero.online/zhao/files/raw/branch/main/docker-compose/Gitea -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 键返回..."
;;
6)
color_output "\e[34m[部署 sun-panel]\e[0m"
# 检查 SunPanel 容器是否已存在
if docker ps -a --filter "name=sun-panel" | grep -q "sun-panel"; then
color_output "\e[33msun-panel 已经部署过,跳过部署!\e[0m"
read -p "按 Enter 键返回..."
continue
fi
color_output "\e[33m正在部署 SunPanel...\e[0m"
# 创建目录
mkdir -p /opt/sunpanel
# 下载 Docker Compose 文件到 /opt/sunpanel
curl -v -L https://git.kejizero.online/zhao/files/raw/branch/main/docker-compose/SunPanel -o /opt/sunpanel/docker-compose.yml
# 检查是否下载成功
if [ -f "/opt/sunpanel/docker-compose.yml" ]; then
color_output "\e[32mDocker Compose 文件下载成功!\e[0m"
else
color_output "\e[31mDocker Compose 文件下载失败!\e[0m"
read -p "按 Enter 键返回..."
continue
fi
# 部署 SunPanel
docker-compose up -d
cd /opt/sunpanel
docker-compose up -d
if docker ps | grep -q "sun-panel"; then
color_output "\e[32msun-panel 部署成功!\e[0m"
else
color_output "\e[31msun-panel 部署失败!\e[0m"
docker logs $(docker ps -a -q --filter "name=sun-panel") # 查看失败的容器日志
fi
read -p "按 Enter 键返回..."
;;
0)
show_menu
return