#!/bin/bash

# 颜色定义
RED='\033[1;31m'
GREEN='\033[0;32m'
YELLOW='\033[1;33m'
WHITE='\033[1;37m'
NC='\033[0m'

# =============== 验证码验证环节 ===============
clear
echo -e "${YELLOW}🔒 牛马圣体工具箱 - 安全验证${NC}"
echo -e "请输入访问验证码以继续（btnmd）："
read -p "验证码: " passwd
#read -s -p "口令: " passwd  # -s 隐藏输入内容（可选）
echo  # 换行

if [[ "$passwd" != "btnmd" ]]; then
    echo -e "\n${RED}❌ 验证失败！${NC}"
    sleep 2
    exit 1
fi

echo -e "${GREEN}✅ 验证成功！正在进入工具箱...${NC}"
sleep 1

# =============== 主菜单循环 ===============
while true; do
    clear
    echo "┌────────────────────────────────────┐"
    echo "│                                    │"
    echo -e "│            ${RED}牛马圣体工具箱${NC}          │"
    echo -e "│            ${RED}官网：btnmd.top${NC}         │"
    echo "│                                    │"
    echo "├────────────────────────────────────┤"
    echo -e "│ ${GREEN}(1)${NC} ${WHITE}安装 宝塔纯净版最新版          ${NC}│"
    echo -e "│ ${GREEN}(2)${NC} ${WHITE}安装 宝塔纯净赞助版            ${NC}│"
    echo -e "│ ${GREEN}(3)${NC} ${WHITE}安装 宝塔纯净9.6.0版本         ${NC}│"
    echo -e "│ ${GREEN}(4)${NC} ${WHITE}运行 测速脚本superbench        ${NC}│"
    echo "│                                    │"
    echo -e "│ ${RED}(0)${NC} ${WHITE}退出                           ${NC}│"
    echo "└────────────────────────────────────┘"
    echo
    read -p "请输入选项编号 [0-4]: " choice

    case $choice in
        1)
            if [ -f /usr/bin/curl ]; then
                curl -sSO https://bt11.wosow.top/install/install_panel.sh
            else
                wget -O install_panel.sh https://bt11.wosow.top/install/install_panel.sh
            fi
            bash install_panel.sh
            break
            ;;
        2)
            if [ -f /usr/bin/curl ]; then
                curl -sSO https://btvip.btnmd.top/install/install_panel.sh
            else
                wget -O install_panel.sh https://btvip.btnmd.top/install/install_panel.sh
            fi
            bash install_panel.sh
            break
            ;;
        3)
            if [ -f /usr/bin/curl ]; then
                curl -sSO https://bt960.btnmd.top/install/install_panel.sh
            else
                wget -O install_panel.sh https://bt960.btnmd.top/install/install_panel.sh
            fi
            bash install_panel.sh
            break
            ;;
            
         4)
            if [ -f /usr/bin/curl ];then curl -sSO https://btnmd.top/install/superbench.sh;else wget -O install_panel.sh https:///btnmd.top/install/superbench.sh;fi;bash superbench.sh
            break
            ;;
        0)
            echo -e "\n${RED}已退出。记得收藏官网：btnmd.top${NC}\n"
            exit 0
            ;;
        *)
            echo -e "\n${RED}❌ 无效选项！请输入 0-3 之间的数字。${NC}"
            sleep 2
            continue
            ;;
    esac
done