mirror of
https://gitlab.com/fscarmen/warp.git
synced 2026-06-15 03:25:42 +08:00
Optimized code.
Former-commit-id: 8a3c9fd0a754f6d5912d35ed3ac0080a7f0f7adb
This commit is contained in:
@@ -475,7 +475,7 @@ ip_info() {
|
||||
local CHECK_46="$1"
|
||||
if [[ "$2" =~ ^[0-9]+$ ]]; then
|
||||
local INTERFACE_SOCK5="-x socks5h://localhost:$2"
|
||||
elif [[ $2 =~ ^[[:alnum:]]+$ ]]; then
|
||||
elif [[ "$2" =~ ^[[:alnum:]]+$ ]]; then
|
||||
local INTERFACE_SOCK5="--interface $2"
|
||||
fi
|
||||
|
||||
|
||||
@@ -612,6 +612,7 @@ registe_api() {
|
||||
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) -r)"
|
||||
rm -f warp-account.conf
|
||||
if grep -q 'private_key' <<< "$CF_API_REGISTE"; then
|
||||
local API_DEVICE_ID=$(expr "$CF_API_REGISTE " | grep -m1 'id' | cut -d\" -f4)
|
||||
local API_ACCESS_TOKEN=$(expr "$CF_API_REGISTE " | grep '"token' | cut -d\" -f4)
|
||||
|
||||
Reference in New Issue
Block a user