更新 bin/ ZeroWrt.backup

Signed-off-by: zhao <zhao@noreply.localhost>
This commit is contained in:
zhao 2025-01-24 17:08:32 +08:00
parent c9bedb92c7
commit 8bcde7d9c8

View File

@ -149,19 +149,85 @@ change_source() {
color_output "1. 阿里源" color_output "1. 阿里源"
color_output "2. 清华源" color_output "2. 清华源"
color_output "3. 中科大源" color_output "3. 中科大源"
color_output "4. 官方源" color_output "4. 高校联合镜像站"
color_output "5. 南方科技大学"
color_output "6. 官方源"
color_output "0. 返回" color_output "0. 返回"
read -p "请输入您的选择 [0-4]: " source_choice read -p "请输入您的选择 [0-6]: " source_choice
case "$source_choice" in # 检测当前设备架构
1) base_url="https://mirrors.aliyun.com/openwrt/releases/24.10.0-rc5/packages/x86_64" ;; arch=$(uname -m)
2) base_url="https://mirrors.tuna.tsinghua.edu.cn/openwrt/releases/24.10.0-rc5/packages/x86_64" ;;
3) base_url="https://mirrors.ustc.edu.cn/openwrt/releases/24.10.0-rc5/packages/x86_64" ;; # 针对不同架构的设置
4) base_url="https://downloads.openwrt.org/releases/24.10.0-rc5/packages/x86_64" ;; case "$arch" in
0) show_menu ; return ;; "x86_64")
*) color_output "\e[31m无效选项返回菜单。\e[0m" ; show_menu ; return ;; arch_name="x86_64"
;;
"i386" | "pentium4")
arch_name="i386_pentium4"
;;
"aarch64")
arch_name="aarch64_generic"
;;
"armv7l")
arch_name="arm_cortex-a9"
;;
"armv6l")
arch_name="arm_arm1176jzf-s_vfp"
;;
"mips64el")
arch_name="mips64el"
;;
"mipsel")
arch_name="mipsel_24kc"
;;
"aarch64_cortex-a72")
arch_name="aarch64_cortex-a72"
;;
"aarch64_cortex-a53")
arch_name="aarch64_cortex-a53"
;;
"armv5te")
arch_name="arm_cortex-a5_vfpv4"
;;
"armv8")
arch_name="arm_cortex-a15_neon-vfpv4"
;;
*)
color_output "\e[31m不支持此架构$arch请选择其他源。\e[0m"
return
;;
esac esac
# 根据选择的源和架构来设置对应的 base_url
case "$source_choice" in
1)
base_url="https://mirrors.aliyun.com/openwrt/releases/24.10.0-rc6/packages/$arch_name"
;;
2)
base_url="https://mirrors.tuna.tsinghua.edu.cn/openwrt/releases/24.10.0-rc6/packages/$arch_name"
;;
3)
base_url="https://mirrors.ustc.edu.cn/openwrt/releases/24.10.0-rc6/packages/$arch_name"
;;
4)
base_url="https://mirrors.xjtu.edu.cn/openwrt/releases/24.10.0-rc6/packages/$arch_name"
;;
5)
base_url="https://mirrors.sustech.edu.cn/openwrt/releases/24.10.0-rc6/packages/$arch_name"
;;
6)
base_url="https://downloads.openwrt.org/releases/24.10.0-rc6/packages/$arch_name"
;;
0) show_menu ; return ;;
*)
color_output "\e[31m无效选项返回菜单。\e[0m"
show_menu
return
;;
esac
# 更新软件源
cat <<EOF > /etc/opkg/distfeeds.conf cat <<EOF > /etc/opkg/distfeeds.conf
src/gz openwrt_base $base_url/base src/gz openwrt_base $base_url/base
src/gz openwrt_luci $base_url/luci src/gz openwrt_luci $base_url/luci
@ -503,7 +569,6 @@ install_apps() {
fi fi
# 部署 Gitea 和 MySQL # 部署 Gitea 和 MySQL
opkg install docker-compose
cd /opt/Gitea cd /opt/Gitea
docker-compose up -d docker-compose up -d
@ -515,11 +580,11 @@ install_apps() {
read -p "按 Enter 键返回..." read -p "按 Enter 键返回..."
;; ;;
6) 6)
color_output "\e[34m[部署 SunPanel]\e[0m" color_output "\e[34m[部署 sun-panel]\e[0m"
# 检查 SunPanel 容器是否已存在 # 检查 SunPanel 容器是否已存在
if docker ps -a | grep -q "sunpanel"; then if docker ps -a --filter "name=sun-panel" | grep -q "sun-panel"; then
color_output "\e[33mSunPanel 已经部署过,跳过部署!\e[0m" color_output "\e[33msun-panel 已经部署过,跳过部署!\e[0m"
read -p "按 Enter 键返回..." read -p "按 Enter 键返回..."
continue continue
fi fi
@ -530,7 +595,7 @@ install_apps() {
mkdir -p /opt/sunpanel mkdir -p /opt/sunpanel
# 下载 Docker Compose 文件到 /opt/sunpanel # 下载 Docker Compose 文件到 /opt/sunpanel
curl -L https://git.kejizero.online/zhao/files/raw/branch/main/docker-compose/SunPanel -o /opt/sunpanel/docker-compose.yml 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 if [ -f "/opt/sunpanel/docker-compose.yml" ]; then
@ -542,14 +607,15 @@ install_apps() {
fi fi
# 部署 SunPanel # 部署 SunPanel
opkg install docker-compose docker-compose up -d
cd /opt/sunpanel cd /opt/sunpanel
docker-compose up -d docker-compose up -d
if docker ps | grep -q "sunpanel"; then if docker ps | grep -q "sun-panel"; then
color_output "\e[32mSunPanel 部署成功!\e[0m" color_output "\e[32msun-panel 部署成功!\e[0m"
else else
color_output "\e[31mSunPanel 部署失败!\e[0m" color_output "\e[31msun-panel 部署失败!\e[0m"
docker logs $(docker ps -a -q --filter "name=sun-panel") # 查看失败的容器日志
fi fi
read -p "按 Enter 键返回..." read -p "按 Enter 键返回..."
;; ;;