From e67fe098e6c4c763e543f0bdbc6e687707614a61 Mon Sep 17 00:00:00 2001 From: Evgeny Nerush Date: Tue, 7 Apr 2026 17:50:36 +0300 Subject: [PATCH] fix for new xray x25519 format --- ex.sh | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/ex.sh b/ex.sh index 5c8943f..65f510a 100755 --- a/ex.sh +++ b/ex.sh @@ -168,12 +168,18 @@ or leave blank for simple default configuration:" then keys=$(xray x25519) # string "Private key: Abc... Public key: Xyz..." keysF=$(echo $keys | cut -d " " -f 1) # which keys format xray uses? + keyF2=$(echo $keys | cut -d " " -f 4) if [ $keysF = "Private" ]; then private_key=$(echo $keys | cut -d " " -f 3) # get 3rd field of fields delimited by spaces public_key=$(echo $keys | cut -d " " -f 6) # get 6th field else - private_key=$(echo $keys | cut -d " " -f 2) - public_key=$(echo $keys | cut -d " " -f 4) + if [ $keysF2 = "(PublicKey):" ]; then + private_key=$(echo $keys | cut -d " " -f 2) + public_key=$(echo $keys | cut -d " " -f 5) + else + private_key=$(echo $keys | cut -d " " -f 2) + public_key=$(echo $keys | cut -d " " -f 4) + fi fi fi short_id=$(openssl rand -hex 8) # random short_id for REALITY