mirror of
https://gitlab.com/fscarmen/warp.git
synced 2026-06-15 03:25:42 +08:00
Fix a bug in registe api.
Former-commit-id: 2196a48c1a2939fbe4f3ce8834d4cbfbb2c71326
This commit is contained in:
@@ -75,7 +75,7 @@ registe_account() {
|
||||
--header 'Content-Type: application/json' \
|
||||
--header "Cf-Access-Jwt-Assertion: ${team_token}" \
|
||||
--data '{"key":"'${public_key}'","install_id":"'${install_id}'","fcm_token":"'${fcm_token}'","tos":"'$(date +"%Y-%m-%dT%H:%M:%S.000Z")'","model":"PC","serial_number":"'${install_id}'","locale":"zh_CN"}' \
|
||||
| python3 -m json.tool | sed "/\"account_type\"/i\ \"private_key\": \"$private_key\"" > $registe_path
|
||||
| python3 -m json.tool | sed "/\"account_type\"/i\ \"private_key\": \"$private_key\"," > $registe_path
|
||||
|
||||
[ -s $registe_path ] && cat $registe_path && grep -q 'error code' $registe_path && rm -f $registe_path
|
||||
}
|
||||
|
||||
@@ -1426,7 +1426,7 @@ input_url_token() {
|
||||
[ -z "$TEAM_TOKEN" ] && return
|
||||
|
||||
unset TEAMS ADDRESS6 PRIVATEKEY RESERVED
|
||||
TEAMS=$(bash <(curl -m5 -sSL https://raw.githubusercontent.com/fscarmen/warp/main/api.sh | sed 's# > $registe_path##') --registe --token $TEAM_TOKEN)
|
||||
TEAMS=$(bash <(curl -m5 -sSL https://raw.githubusercontent.com/fscarmen/warp/main/api.sh | sed 's# > $registe_path##; /cat $registe_path/d') --registe --token $TEAM_TOKEN)
|
||||
ADDRESS6=$(expr "$TEAMS" : '.*"v6":[ ]*"\([^"]*\).*')
|
||||
PRIVATEKEY=$(expr "$TEAMS" : '.*"private_key":[ ]*"\([^"]*\).*')
|
||||
RESERVED=$(reserved_and_clientid $(expr "$TEAMS" : '.*"client_id":[ ]*"\([^"]*\).*') reserved)
|
||||
|
||||
+1
-1
@@ -660,7 +660,7 @@ registe_api() {
|
||||
if ! grep -sq 'PrivateKey' /opt/warp-go/$REGISTE_FILE; then
|
||||
unset CF_API_REGISTE API_DEVICE_ID API_ACCESS_TOKEN API_PRIVATEKEY API_TYPE
|
||||
rm -f /opt/warp-go/$REGISTE_FILE
|
||||
CF_API_REGISTE="$(bash <(curl -m8 -sSL https://raw.githubusercontent.com/fscarmen/warp/main/api.sh | sed 's# > $registe_path##g') --registe --token $TOKEN 2>/dev/null)"
|
||||
CF_API_REGISTE="$(bash <(curl -m8 -sSL https://raw.githubusercontent.com/fscarmen/warp/main/api.sh | sed 's# > $registe_path##g; /cat $registe_path/d') --registe --token $TOKEN 2>/dev/null)"
|
||||
[[ -n "$NF" && -n "$EXPECT" && -s /opt/warp-go/License ]] && LICENSE=$(cat /opt/warp-go/License) && NAME=$(cat /opt/warp-go/Device_Name)
|
||||
[[ -z "$LICENSE" && -s /opt/warp-go/License ]] && rm -f /opt/warp-go/License /opt/warp-go/Device_Name
|
||||
if grep -q 'private_key' <<< "$CF_API_REGISTE"; then
|
||||
|
||||
Reference in New Issue
Block a user