From 60cbf511f7742484320d4c6fc6fcc236dbc80c75 Mon Sep 17 00:00:00 2001 From: sdohuajia <63113882+sdohuajia@users.noreply.github.com> Date: Wed, 9 Oct 2024 20:14:31 +0800 Subject: [PATCH] Update nexus.sh --- nexus.sh | 52 ++++++++++++++++------------------------------------ 1 file changed, 16 insertions(+), 36 deletions(-) diff --git a/nexus.sh b/nexus.sh index 3146d6f..a7e7317 100644 --- a/nexus.sh +++ b/nexus.sh @@ -1,28 +1,8 @@ #!/bin/bash -# 自定义状态显示函数 -show_status() { - local message="$1" - local status="$2" - case $status in - "error") - echo -e "${RED}${BOLD}🚫 出错: ${message}${NORMAL}" - ;; - "progress") - echo -e "${YELLOW}${BOLD}🔄 进行中: ${message}${NORMAL}" - ;; - "success") - echo -e "${GREEN}${BOLD}✅ 成功: ${message}${NORMAL}" - ;; - *) - echo -e "${PINK}${BOLD}${message}${NORMAL}" - ;; - esac -} - # 定义服务名称和文件路径 SERVICE_NAME="nexus" -SERVICE_FILE="/etc/systemd/system/$SERVICE_NAME.service" +SERVICE_FILE="/etc/systemd/system/nexus.service" # 更新服务文件路径 # 主菜单函数 function main_menu() { @@ -116,15 +96,15 @@ function start_node() { # 安装依赖项 cd $HOME/network-api/clients/cli - show_status "安装所需的依赖项..." + echo "安装所需的依赖项..." if ! sudo apt install pkg-config libssl-dev -y; then - show_status "安装依赖项失败。" "error" + echo "安装依赖项失败。" # 错误信息 exit 1 fi # 创建 systemd 服务文件 - show_status "创建 systemd 服务..." - SERVICE_FILE="/etc/systemd/system/$SERVICE_NAME.service" # 定义服务文件路径 + echo "创建 systemd 服务..." + SERVICE_FILE="/etc/systemd/system/nexus.service" # 更新服务文件路径 if ! sudo bash -c "cat > $SERVICE_FILE <