Optimized code.

Former-commit-id: 8a3c9fd0a754f6d5912d35ed3ac0080a7f0f7adb
This commit is contained in:
fscarmen
2023-05-21 13:51:41 +00:00
parent a724f8a70d
commit b9cfad78bb
2 changed files with 2 additions and 1 deletions
+1 -1
View File
@@ -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
+1
View File
@@ -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)