mirror of
https://github.com/everett7623/nodeloc_vps_test.git
synced 2024-12-27 00:35:19 +00:00
Update nodeloc_vps_autotest_ip.sh
This commit is contained in:
parent
29a2d79a27
commit
68aaa8a18f
@ -158,22 +158,29 @@ run_all_tests() {
|
|||||||
|
|
||||||
# 格式化结果为 Markdown
|
# 格式化结果为 Markdown
|
||||||
format_results() {
|
format_results() {
|
||||||
result="[tabs]
|
# 转义特殊字符,但保留颜色代码
|
||||||
|
escaped_result=$(echo "$ip_quality_result" | sed 's/\\/\\\\/g; s/`/\\`/g; s/\$/\\$/g; s/\*/\\*/g; s/_/\\_/g')
|
||||||
|
|
||||||
|
result="[tabs]
|
||||||
[tab=\"IP质量\"]
|
[tab=\"IP质量\"]
|
||||||
\`\`\`
|
\`\`\`ansi
|
||||||
$ip_quality_result
|
$escaped_result
|
||||||
\`\`\`
|
\`\`\`
|
||||||
[/tab]
|
[/tab]
|
||||||
[/tabs]
|
[/tabs]
|
||||||
"
|
"
|
||||||
echo "$result" | iconv -f UTF-8 -t UTF-8//IGNORE > results.md
|
echo "$result" > results.md
|
||||||
echo -e "${GREEN}结果已保存到 results.md 文件中。${NC}"
|
echo -e "${GREEN}结果已保存到 results.md 文件中。${NC}"
|
||||||
}
|
}
|
||||||
|
|
||||||
# 主函数
|
# 主函数
|
||||||
main() {
|
main() {
|
||||||
install_dependencies
|
if type install_dependencies &>/dev/null; then
|
||||||
show_welcome
|
install_dependencies
|
||||||
|
fi
|
||||||
|
if type show_welcome &>/dev/null; then
|
||||||
|
show_welcome
|
||||||
|
fi
|
||||||
run_all_tests
|
run_all_tests
|
||||||
echo -e "${GREEN}所有测试完成。结果已保存到 results.md 文件中。${NC}"
|
echo -e "${GREEN}所有测试完成。结果已保存到 results.md 文件中。${NC}"
|
||||||
echo "最终结果文件内容:" >&2
|
echo "最终结果文件内容:" >&2
|
||||||
|
Loading…
Reference in New Issue
Block a user