Update nodeloc_vps_autotest_ip.sh

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

View File

@ -123,6 +123,11 @@ 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}"
@ -130,6 +135,7 @@ 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}"