Update nodeloc_vps_autotest_ip.sh

This commit is contained in:
Jensfrank 2024-06-27 12:48:43 +08:00 committed by GitHub
parent 3ded3c6dc9
commit 515b9e1f07
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -156,17 +156,20 @@ run_all_tests() {
format_results
}
# 格式化结果为 Markdown
format_results() {
result="[tabs]
# 预处理 IP 质量结果,去除可能导致问题的字符
cleaned_result=$(echo "$ip_quality_result" | sed 's/[[:cntrl:]]//g' | iconv -f UTF-8 -t UTF-8 -c)
result="[tabs]
[tab=\"IP质量\"]
\`\`\`
$ip_quality_result
$cleaned_result
\`\`\`
[/tab]
[/tabs]
"
echo "$result" > results.md
# 使用 UTF-8 编码写入文件
echo "$result" | iconv -f UTF-8 -t UTF-8 -c > results.md
echo -e "${GREEN}结果已保存到 results.md 文件中。${NC}"
}