From 7caeb672001576ffd28e350f9ad193b7c8424f5d Mon Sep 17 00:00:00 2001 From: sdohuajia <63113882+sdohuajia@users.noreply.github.com> Date: Wed, 9 Oct 2024 20:02:23 +0800 Subject: [PATCH] Update nexus.sh --- nexus.sh | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/nexus.sh b/nexus.sh index b06a1af..1aa9027 100644 --- a/nexus.sh +++ b/nexus.sh @@ -38,9 +38,10 @@ function main_menu() { echo "2. 查看 Prover 状态" echo "3. 查看日志" echo "4. 删除节点" - echo "5. 退出" + echo "5. 显示 ID" # 新增选项 + echo "6. 退出" # 更新退出选项 - read -p "请输入选项 (1-5): " choice + read -p "请输入选项 (1-6): " choice case $choice in 1) @@ -56,6 +57,9 @@ function main_menu() { delete_node # 调用删除节点函数 ;; 5) + show_id # 调用显示 ID 函数 + ;; + 6) echo "退出脚本。" exit 0 ;; @@ -66,6 +70,16 @@ function main_menu() { done } +# 显示 ID 的函数 +function show_id() { + if [ -f /root/.nexus/prover-id ]; then + echo "Prover ID 内容:" + cat /root/.nexus/prover-id # 显示文件内容 + else + echo "文件 /root/.nexus/prover-id 不存在。" + fi +} + # 启动节点的函数 function start_node() { # 检查并安装 Git