Update nodeloc_vps_autotest.sh

This commit is contained in:
Jensfrank 2024-06-26 17:15:56 +08:00 committed by GitHub
parent a7ce924f28
commit ca2058bb1e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -93,13 +93,29 @@ detect_region() {
local country local country
country=$(curl -s ipinfo.io/country) country=$(curl -s ipinfo.io/country)
case $country in case $country in
"US") echo "na" ;; # 北美 "TW") echo "1" ;; # 台湾
"CA") echo "na" ;; "HK") echo "2" ;; # 香港
# 添加更多国家和地区的映射 "JP") echo "3" ;; # 日本
*) echo "default" ;; "US" | "CA") echo "4" ;; # 北美
"BR" | "AR" | "CL") echo "5" ;; # 南美
"GB" | "DE" | "FR" | "NL" | "SE" | "NO" | "FI" | "DK" | "IT" | "ES" | "CH" | "AT" | "BE") echo "6" ;; # 欧洲
"AU" | "NZ") echo "7" ;; # 大洋洲
"KR") echo "8" ;; # 韩国
"SG" | "MY" | "TH" | "ID" | "PH" | "VN") echo "9" ;; # 东南亚
"IN") echo "10" ;; # 印度
"ZA" | "NG" | "EG") echo "11" ;; # 非洲
*) echo "0" ;; # 跨国平台
esac esac
} }
# 流媒体解锁测试函数
run_streaming_test() {
local region
region=$(detect_region)
echo "运行${YELLOW}流媒体解锁测试...${NC}"
streaming_result=$(run_and_capture "echo '$region' | bash <(curl -L -s media.ispvps.com)")
}
# 统计使用次数 # 统计使用次数
sum_run_times() { sum_run_times() {
local COUNT local COUNT
@ -172,8 +188,7 @@ run_all_tests() {
# 流媒体解锁 # 流媒体解锁
echo "运行${YELLOW}流媒体解锁测试...${NC}" echo "运行${YELLOW}流媒体解锁测试...${NC}"
region=$(detect_region) run_streaming_test
streaming_result=$(run_and_capture "echo '$region' | bash <(curl -L -s media.ispvps.com)")
# 响应测试 # 响应测试
echo "运行${YELLOW}响应测试...${NC}" echo "运行${YELLOW}响应测试...${NC}"