From 2eab88b452e6a2aa506dca1b30aa98caba00c539 Mon Sep 17 00:00:00 2001 From: yyhuni Date: Sat, 27 Dec 2025 12:41:04 +0800 Subject: [PATCH] chore(install): Add banner display and update confirmation - Add show_banner() function to display XingRin ASCII art logo - Call show_banner() before header in install.sh initialization - Add experimental feature warning in update.sh with user confirmation - Prompt user to confirm before proceeding with update operation - Suggest full reinstall via uninstall.sh and install.sh as alternative - Improve user experience with visual feedback and safety checks --- install.sh | 17 +++++++++++++++++ update.sh | 14 ++++++++++++++ 2 files changed, 31 insertions(+) diff --git a/install.sh b/install.sh index 747b2f32..a84d63be 100755 --- a/install.sh +++ b/install.sh @@ -64,6 +64,22 @@ header() { echo -e "${BOLD}${BLUE}============================================================${RESET}" } +# ============================================================================== +# 显示横幅 +# ============================================================================== +show_banner() { + echo -e "${CYAN}" + cat << 'EOF' + __ __ _ ____ _ + \ \/ /(_)_ __ __ _| _ \(_)_ __ + \ / | | '_ \ / _` | |_) | | '_ \ + / \ | | | | | (_| | _ <| | | | | + /_/\_\|_|_| |_|\__, |_| \_\_|_| |_| + |___/ +EOF + echo -e "${RESET}" +} + # ============================================================================== # 权限检查 # ============================================================================== @@ -96,6 +112,7 @@ else fi # 显示标题 +show_banner header "XingRin 一键安装脚本 (Ubuntu)" info "当前用户: ${BOLD}$REAL_USER${RESET}" info "项目路径: ${BOLD}$ROOT_DIR${RESET}" diff --git a/update.sh b/update.sh index 1b99f993..dc9fbbce 100755 --- a/update.sh +++ b/update.sh @@ -83,6 +83,20 @@ fi echo -e "${BOLD}${BLUE}╚════════════════════════════════════════╝${NC}" echo "" +# 测试性功能警告 +echo -e "${BOLD}${YELLOW}[!] 警告:此功能为测试性功能,可能会导致升级失败${NC}" +echo -e "${YELLOW} 建议运行 ./uninstall.sh 后重新执行 ./install.sh 进行全新安装${NC}" +echo "" +echo -n -e "${YELLOW}是否继续更新?(y/N) ${NC}" +read -r ans_continue +ans_continue=${ans_continue:-N} + +if [[ ! $ans_continue =~ ^[Yy]$ ]]; then + echo -e "${CYAN}已取消更新。${NC}" + exit 0 +fi +echo "" + echo -e "${CYAN}[1/4]${NC} 停止服务..." ./stop.sh 2>&1 | sed 's/^/ /'