更新 bin/ZeroWrt

Signed-off-by: zhao <zhao@noreply.localhost>
This commit is contained in:
zhao 2024-12-27 00:02:55 +08:00
parent 83d9775be6
commit de4e951fdb

View File

@ -45,7 +45,7 @@ show_menu() {
color_output "\e[36m┃\e[0m 3. 切换默认主题 \e[36m┃\e[0m"
color_output "\e[36m┃\e[0m 4. 恢复出厂设置 \e[36m┃\e[0m"
color_output "\e[36m┃\e[0m 5. 一键换源 \e[36m┃\e[0m"
color_output "\e[36m┃\e[0m 6. 安装 ShellClash \e[36m┃\e[0m"
color_output "\e[36m┃\e[0m 6. 一键部署 \e[36m┃\e[0m"
color_output "\e[36m┃\e[0m 7. 检测更新 \e[36m┃\e[0m"
color_output "\e[36m┃\e[0m 0. 退出 \e[36m┃\e[0m"
color_output "\e[36m┃ ┃\e[0m"
@ -57,7 +57,7 @@ show_menu() {
3) change_theme ;;
4) reset_config ;;
5) change_source ;;
6) install_shellclash ;;
6) install_apps ;;
7) check_update ;;
0) exit 0 ;;
*) echo "无效选项,请重新输入"; show_menu ;;
@ -155,26 +155,67 @@ EOF
show_menu
}
# 6. 安装 ShellClash
install_shellclash() {
color_output "\e[34m[安装 ShellClash]\e[0m"
color_output "\e[36m请选择 ShellClash 的安装源:\e[0m"
color_output "1. GitHub 源"
color_output "2. jsDelivr CDN 源"
color_output "0. 返回"
read -p "请输入您的选择 [0-2]: " install_choice
# 6. 一键部署
install_apps() {
while true; do
clear
color_output "\e[34m[一键部署]\e[0m"
color_output "\e[36m┏━━━━━━━━━━━━━━━ 部署选项 ━━━━━━━━━━━━━━━┓\e[0m"
color_output "\e[36m┃ ┃\e[0m"
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 0. 返回主菜单 \e[36m┃\e[0m"
color_output "\e[36m┃ ┃\e[0m"
color_output "\e[36m┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛\e[0m"
case "$install_choice" in
1) export url='https://raw.githubusercontent.com/juewuy/ShellCrash/master' ;;
2) export url='https://fastly.jsdelivr.net/gh/juewuy/ShellCrash@master' ;;
0) show_menu ; return ;;
*) color_output "\e[31m无效选项返回菜单。\e[0m" ; show_menu ; return ;;
esac
read -p "$(color_output "\e[33m请输入您的选择 [0-2]: \e[0m")" app_choice
sh -c "$(curl -kfsSl $url/install.sh)" && source /etc/profile &> /dev/null
color_output "\e[32mShellClash 已成功安装。\e[0m"
read -p "按 Enter 键返回菜单..."
show_menu
case "$app_choice" in
1)
color_output "\e[34m[安装 ShellClash]\e[0m"
color_output "\e[36m请选择 ShellClash 的安装源:\e[0m"
color_output "1. GitHub 源"
color_output "2. jsDelivr CDN 源"
color_output "0. 返回"
read -p "请输入您的选择 [0-2]: " install_choice
case "$install_choice" in
1) export url='https://raw.githubusercontent.com/juewuy/ShellCrash/master' ;;
2) export url='https://fastly.jsdelivr.net/gh/juewuy/ShellCrash@master' ;;
0) continue ;;
*)
color_output "\e[31m无效选项\e[0m"
sleep 2
continue
;;
esac
if [ "$install_choice" != "0" ]; then
sh -c "$(curl -kfsSl $url/install.sh)" && source /etc/profile &> /dev/null
color_output "\e[32mShellClash 已成功安装。\e[0m"
read -p "按 Enter 键继续..."
fi
;;
2)
color_output "\e[34m[安装小雅 Alist]\e[0m"
color_output "\e[33m正在安装小雅 Alist...\e[0m"
bash -c "$(curl --insecure -fsSL https://ddsrem.com/xiaoya_install.sh)"
color_output "\e[32m小雅 Alist 安装完成。\e[0m"
read -p "按 Enter 键继续..."
;;
0)
show_menu
return
;;
*)
color_output "\e[31m无效选项请重新选择\e[0m"
sleep 2
;;
esac
done
}
# 7. 检测更新