From 2ec089f0e07993de9f5b8fb72cfbf405eef17a89 Mon Sep 17 00:00:00 2001 From: Whispering Wind <151555003+ReturnFI@users.noreply.github.com> Date: Tue, 17 Dec 2024 13:07:13 +0330 Subject: [PATCH] shows the URI with the -s and -n --- menu.sh | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/menu.sh b/menu.sh index 8cc4d66..8c40caf 100644 --- a/menu.sh +++ b/menu.sh @@ -212,18 +212,35 @@ hysteria2_reset_user_handler() { } hysteria2_show_user_uri_handler() { + check_service_active() { + systemctl is-active --quiet "$1" + } + while true; do read -p "Enter the username: " username - if [[ "$username" =~ ^[a-zA-Z0-9]+$ ]]; then break else echo -e "${red}Error:${NC} Username can only contain letters and numbers." fi done - python3 $CLI_PATH show-user-uri --username "$username" -a -qr + + flags="" + + if check_service_active "singbox.service"; then + flags+=" -s" + fi + + if check_service_active "normalsub.service"; then + flags+=" -n" + fi + + if [[ -n "$flags" ]]; then + python3 $CLI_PATH show-user-uri --username "$username" -a -qr $flags + fi } + hysteria2_change_port_handler() { while true; do read -p "Enter the new port number you want to use: " port