From 432b807e4c94a03e7f66314bcea1dd3b89385b09 Mon Sep 17 00:00:00 2001 From: gooaclok819 Date: Fri, 25 Oct 2024 03:54:15 +0800 Subject: [PATCH] 1.6.1 --- menu.sh | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/menu.sh b/menu.sh index 275004b..07b439d 100644 --- a/menu.sh +++ b/menu.sh @@ -47,6 +47,7 @@ function Select { echo "5. 查看运行目录" echo "6. 修改端口" echo "7. 更新" + echo "8. 重置账号密码" echo "0. 退出" echo -n "请选择一个选项: " read option @@ -138,6 +139,22 @@ function Select { Up fi ;; + 8) + systemctl stop sublink + read -p "请输入新的账号: " User + read -p "请输入新的密码: " Password + # 运行二进制文件并传递启动参数,放在后台运行 + /usr/local/bin/sublink/sublink -setting -username "$User" -password "$Password" & + # 获取该程序的PID + pid=$! + # 等待程序完成 + wait $pid + # 如果需要可以在此处进行清理 + echo "新的账号: $User" + echo "新的密码: $Password" + systemctl daemon-reload + systemctl start sublink + ;; 0) exit 0 ;;