mirror of
https://github.com/everett7623/nodeloc_vps_test.git
synced 2024-11-20 15:05:22 +00:00
Update Nlbench.sh
This commit is contained in:
parent
4f42365214
commit
51275673b8
36
Nlbench.sh
36
Nlbench.sh
@ -129,8 +129,7 @@ declare -a test_results
|
||||
|
||||
# 在每个命令执行后保存结果
|
||||
run_and_capture() {
|
||||
local command_output
|
||||
command_output=$(eval "$1" 2>&1)
|
||||
local command_output=$(eval "$1" 2>&1)
|
||||
test_results+=("$command_output")
|
||||
echo "$command_output"
|
||||
}
|
||||
@ -185,13 +184,11 @@ speedtest_multi_process_output() {
|
||||
echo "去除 ANSI 转义码后的输出: $no_ansi" >&2
|
||||
|
||||
# Step 2: 过滤掉包含 "测试进行中" 的行
|
||||
local no_progress
|
||||
no_progress=$(echo "$no_ansi" | grep -v "^ *测试进行中")
|
||||
local no_progress=$(echo "$no_ansi" | grep -v "^ *测试进行中")
|
||||
echo "过滤掉包含 '测试进行中' 的行后的输出: $no_progress" >&2
|
||||
|
||||
# Step 3: 截取所需的测试结果
|
||||
local speedtest_multi_process_output_result
|
||||
speedtest_multi_process_output_result=$(echo "$no_progress" | awk '/大陆三网\+教育网 IPv4 多线程测速/{f=1} f; /北京时间/{f=0}')
|
||||
local speedtest_multi_process_output_result=$(echo "$no_progress" | awk '/大陆三网\+教育网 IPv4 多线程测速/{f=1} f; /北京时间/{f=0}')
|
||||
echo "$speedtest_multi_process_output_result"
|
||||
}
|
||||
|
||||
@ -209,8 +206,7 @@ speedtest_single_process_output() {
|
||||
echo "过滤掉包含 '测试进行中' 的行后的输出: $no_progress" >&2
|
||||
|
||||
# Step 3: 截取所需的测试结果
|
||||
local speedtest_single_process_output_result
|
||||
speedtest_single_process_output_result=$(echo "$no_progress" | awk '/大陆三网\+教育网 IPv4 单线程测速/{f=1} f; /北京时间/{f=0}')
|
||||
local speedtest_single_process_output_result=$(echo "$no_progress" | awk '/大陆三网\+教育网 IPv4 单线程测速/{f=1} f; /北京时间/{f=0}')
|
||||
echo "$speedtest_single_process_output_result"
|
||||
}
|
||||
|
||||
@ -239,8 +235,7 @@ run_all_tests() {
|
||||
|
||||
# 流媒体解锁
|
||||
echo -e "运行${YELLOW}流媒体解锁测试...${NC}"
|
||||
local region
|
||||
region=$(detect_region)
|
||||
local region=$(detect_region)
|
||||
streaming_result=$(run_and_capture "echo '$region' | bash <(curl -L -s media.ispvps.com)")
|
||||
|
||||
# 响应测试
|
||||
@ -269,30 +264,23 @@ format_results() {
|
||||
local processed_yabs_result=$(response_yabs_output "$yabs_result")
|
||||
|
||||
# 处理融合怪结果
|
||||
local processed_fusion_result
|
||||
processed_fusion_result=$(fusion_process_output "$fusion_result")
|
||||
local processed_fusion_result=$(fusion_process_output "$fusion_result")
|
||||
|
||||
# 处理IP质量结果
|
||||
local processed_ip_result
|
||||
processed_ip_result=$(ip_process_output "$ip_quality_result")
|
||||
local processed_ip_result=$(ip_process_output "$ip_quality_result")
|
||||
|
||||
# 处理流媒体解锁结果
|
||||
local processed_streaming_result
|
||||
processed_streaming_result=$(streaming_process_output "$streaming_result")
|
||||
local processed_streaming_result=$(streaming_process_output "$streaming_result")
|
||||
|
||||
# 处理响应测试结果
|
||||
local processed_response_result
|
||||
processed_response_result=$(response_process_output "$response_result")
|
||||
local processed_response_result=$(response_process_output "$response_result")
|
||||
|
||||
# 处理三网测速结果
|
||||
local processed_speedtest_multi_result
|
||||
local processed_speedtest_single_result
|
||||
processed_speedtest_multi_result=$(speedtest_multi_process_output "$speedtest_multi_result")
|
||||
processed_speedtest_single_result=$(speedtest_single_process_output "$speedtest_single_result")
|
||||
local processed_speedtest_multi_result=$(speedtest_multi_process_output "$speedtest_multi_result")
|
||||
local processed_speedtest_single_result=$(speedtest_single_process_output "$speedtest_single_result")
|
||||
|
||||
# 处理回程路由结果
|
||||
local processed_autotrace_result
|
||||
processed_autotrace_result=$(autotrace_process_output "$autotrace_result")
|
||||
local processed_autotrace_result=$(autotrace_process_output "$autotrace_result")
|
||||
|
||||
# Tabs分栏输出结果,用于复制到Nodeloc论坛
|
||||
result="[tabs]
|
||||
|
Loading…
Reference in New Issue
Block a user