Update nodeloc_vps_autotest_ip.sh

This commit is contained in:
Jensfrank 2024-06-27 13:32:27 +08:00 committed by GitHub
parent 20c5237933
commit 3f2ba997aa
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -123,11 +123,6 @@ run_and_capture() {
echo "$command_output" echo "$command_output"
} }
# 清理控制字符的函数
clean_output() {
echo "$1" | sed 's/\x1b\[[0-9;]*[a-zA-Z]//g'
}
# 运行所有测试 # 运行所有测试
run_all_tests() { run_all_tests() {
echo -e "${RED}开始测试,测试时间较长,请耐心等待...${NC}" echo -e "${RED}开始测试,测试时间较长,请耐心等待...${NC}"
@ -135,7 +130,6 @@ run_all_tests() {
# IP质量 # IP质量
echo -e "运行${YELLOW}IP质量测试...${NC}" echo -e "运行${YELLOW}IP质量测试...${NC}"
ip_quality_result=$(run_and_capture "bash <(curl -Ls IP.Check.Place)") ip_quality_result=$(run_and_capture "bash <(curl -Ls IP.Check.Place)")
cleaned_result=$(clean_output "$ip_quality_result")
# 格式化结果 # 格式化结果
echo -e "${YELLOW}此报告由Nodeloc_VPS_自动脚本测试生成...${NC}" echo -e "${YELLOW}此报告由Nodeloc_VPS_自动脚本测试生成...${NC}"
@ -146,7 +140,7 @@ format_results() {
result="[tabs] result="[tabs]
[tab=\"IP质量\"] [tab=\"IP质量\"]
\`\`\` \`\`\`
$cleaned_result $ip_quality_result
\`\`\` \`\`\`
[/tab] [/tab]
[/tabs] [/tabs]