Update nexus.sh

This commit is contained in:
sdohuajia 2024-10-09 23:06:09 +08:00 committed by GitHub
parent 7dbc99b4f5
commit 2c6533bb37
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -29,7 +29,7 @@ function main_menu() {
echo "3. 查看日志"
echo "4. 删除节点"
echo "5. 显示 ID" # 新增选项
echo "6. 退出" # 更新退出选项
echo "6. 改进的状态逻辑" # 新增选项
read -p "请输入选项 (1-6): " choice
@ -50,8 +50,7 @@ function main_menu() {
show_id # 调用显示 ID 函数
;;
6)
echo "退出脚本。"
exit 0
improved_status_logic # 调用改进的状态逻辑函数
;;
*)
echo "无效选项,请重新选择。"
@ -184,5 +183,21 @@ function delete_node() {
read -p "按任意键返回主菜单"
}
# 改进的状态逻辑函数
function improved_status_logic() {
if sudo systemctl is-active --quiet $SERVICE_NAME.service; then
show_status "服务正在运行。"
else
show_status "获取服务状态失败。"
fi
show_status "Nexus Prover 安装和服务设置完成!"
}
# 显示状态的函数
function show_status() {
echo "\$1"
}
# 调用主菜单函数
main_menu