shows the URI with the -s and -n
This commit is contained in:
21
menu.sh
21
menu.sh
@ -212,18 +212,35 @@ hysteria2_reset_user_handler() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
hysteria2_show_user_uri_handler() {
|
hysteria2_show_user_uri_handler() {
|
||||||
|
check_service_active() {
|
||||||
|
systemctl is-active --quiet "$1"
|
||||||
|
}
|
||||||
|
|
||||||
while true; do
|
while true; do
|
||||||
read -p "Enter the username: " username
|
read -p "Enter the username: " username
|
||||||
|
|
||||||
if [[ "$username" =~ ^[a-zA-Z0-9]+$ ]]; then
|
if [[ "$username" =~ ^[a-zA-Z0-9]+$ ]]; then
|
||||||
break
|
break
|
||||||
else
|
else
|
||||||
echo -e "${red}Error:${NC} Username can only contain letters and numbers."
|
echo -e "${red}Error:${NC} Username can only contain letters and numbers."
|
||||||
fi
|
fi
|
||||||
done
|
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() {
|
hysteria2_change_port_handler() {
|
||||||
while true; do
|
while true; do
|
||||||
read -p "Enter the new port number you want to use: " port
|
read -p "Enter the new port number you want to use: " port
|
||||||
|
|||||||
Reference in New Issue
Block a user