Update sb.sh
This commit is contained in:
@@ -4087,17 +4087,21 @@ echo
|
||||
warpwg(){
|
||||
warpcode(){
|
||||
reg(){
|
||||
keypair=$(openssl genpkey -algorithm X25519|openssl pkey -text -noout)
|
||||
keypair=$(openssl genpkey -algorithm X25519 | openssl pkey -text -noout)
|
||||
private_key=$(echo "$keypair" | awk '/priv:/{flag=1; next} /pub:/{flag=0} flag' | tr -d '[:space:]' | xxd -r -p | base64)
|
||||
public_key=$(echo "$keypair" | awk '/pub:/{flag=1} flag' | tr -d '[:space:]' | xxd -r -p | base64)
|
||||
curl -X POST 'https://api.cloudflareclient.com/v0a2158/reg' -sL --tlsv1.3 \
|
||||
-H 'CF-Client-Version: a-7.21-0721' -H 'Content-Type: application/json' \
|
||||
-d \
|
||||
'{
|
||||
"key":"'${public_key}'",
|
||||
"tos":"'$(date +"%Y-%m-%dT%H:%M:%S.000Z")'"
|
||||
}' \
|
||||
| python3 -m json.tool | sed "/\"account_type\"/i\ \"private_key\": \"$private_key\","
|
||||
response=$(curl -sL --tlsv1.3 --connect-timeout 3 --max-time 5 \
|
||||
-X POST 'https://api.cloudflareclient.com/v0a2158/reg' \
|
||||
-H 'CF-Client-Version: a-7.21-0721' \
|
||||
-H 'Content-Type: application/json' \
|
||||
-d '{
|
||||
"key": "'"$public_key"'",
|
||||
"tos": "'"$(date -u +'%Y-%m-%dT%H:%M:%S.000Z')"'"
|
||||
}')
|
||||
if [ -z "$response" ]; then
|
||||
return 1
|
||||
fi
|
||||
echo "$response" | python3 -m json.tool 2>/dev/null | sed "/\"account_type\"/i\ \"private_key\": \"$private_key\","
|
||||
}
|
||||
reserved(){
|
||||
reserved_str=$(echo "$warp_info" | grep 'client_id' | cut -d\" -f4)
|
||||
|
||||
Reference in New Issue
Block a user