diff --git a/install.sh b/install.sh index 638f01d..86cb2df 100644 --- a/install.sh +++ b/install.sh @@ -14,6 +14,8 @@ if [[ "$1" == "--uninstall" ]] || [[ "$1" == "-u" ]] || [[ "$1" == "uninstall" ] MODE="uninstall" elif [[ "$1" == "--update" ]] || [[ "$1" == "--upgrade" ]] || [[ "$1" == "update" ]]; then MODE="update" +elif [[ "$1" == "--repair" ]] || [[ "$1" == "--fix" ]] || [[ "$1" == "repair" ]]; then + MODE="repair" fi # 颜色定义 @@ -2084,12 +2086,13 @@ main() { echo -e "${GREEN}[1]${NC} 安装/部署 玩玩云" echo -e "${BLUE}[2]${NC} 更新/升级 玩玩云" echo -e "${YELLOW}[3]${NC} 修复/重新配置 玩玩云" - echo -e "${RED}[4]${NC} 卸载 玩玩云" + echo -e "${RED}[3]${NC} 卸载 玩玩云" echo "" while true; do read -p "请输入选项 [1-4]: " mode_choice < /dev/tty case $mode_choice in + 1) print_success "已选择: 安装模式" echo "" break @@ -2117,12 +2120,19 @@ main() { ;; esac done - echo -e "${YELLOW}提示:${NC}" + else + # 管道执行时的提示 + print_info "检测到通过管道执行脚本" + print_info "默认进入安装模式" + print_warning "如需其他操作,请下载脚本后运行" + echo "" echo -e "${YELLOW}提示:${NC}" echo " 安装: wget https://gitee.com/yu-yon/vue-driven-cloud-storage/raw/master/install.sh && bash install.sh" echo " 更新: wget https://gitee.com/yu-yon/vue-driven-cloud-storage/raw/master/install.sh && bash install.sh --update" - echo " 修复: wget https://gitee.com/yu-yon/vue-driven-cloud-storage/raw/master/install.sh && bash install.sh --repair" echo " 卸载: wget https://gitee.com/yu-yon/vue-driven-cloud-storage/raw/master/install.sh && bash install.sh --uninstall" + echo " 修复: wget https://gitee.com/yu-yon/vue-driven-cloud-storage/raw/master/install.sh && bash install.sh --repair" + echo "" + sleep 2 fi fi @@ -2211,7 +2221,6 @@ uninstall_main() { } # 执行主流程 - if [[ "$MODE" == "uninstall" ]]; then uninstall_main elif [[ "$MODE" == "update" ]]; then @@ -2221,12 +2230,15 @@ elif [[ "$MODE" == "repair" ]]; then else main fi -################################################################################ + ################################################################################ # 修复功能 ################################################################################ print_repair_banner() { + clear + echo -e "${BLUE}" + echo "╔═══════════════════════════════════════════════════════════════╗" echo "║ ║" echo "║ 🔧 玩玩云 修复模式 ║" echo "║ ║"