Refactor: Implement user information retrieval in Python

This commit is contained in:
Whispering Wind
2025-05-02 12:29:37 +03:30
committed by GitHub
parent 19192bd02d
commit cf4726e5d9
4 changed files with 68 additions and 44 deletions

View File

@ -180,8 +180,8 @@ hysteria2_get_user_handler() {
user_data=$(python3 "$CLI_PATH" get-user --username "$username" 2>/dev/null)
if [[ $? -ne 0 ]]; then
echo -e "${red}Error:${NC} User '$username' not found."
if [[ $exit_code -ne 0 || -z "$user_data" ]]; then
echo -e "${red}Error:${NC} User '$username' not found or invalid response."
return 1
fi