mirror of
https://github.com/everett7623/nodeloc_vps_test.git
synced 2024-12-26 08:15:19 +00:00
Update nodeloc_vps_autotest_ip.sh
This commit is contained in:
parent
11724af80c
commit
17f9056f24
@ -136,27 +136,36 @@ show_welcome() {
|
||||
clear
|
||||
}
|
||||
|
||||
# 创建results.md
|
||||
touch /root/results.md
|
||||
chmod 666 /root/results.md
|
||||
|
||||
# 运行所有测试
|
||||
run_all_tests() {
|
||||
echo -e "${RED}开始测试,测试时间较长,请耐心等待...${NC}"
|
||||
|
||||
# IP质量
|
||||
echo -e "运行${YELLOW}IP质量测试...${NC}"
|
||||
ip_quality_result=$(run_and_capture "bash <(curl -Ls IP.Check.Place) | extract_ip_report")
|
||||
ip_quality_result=$(bash <(curl -Ls IP.Check.Place) | tee >(cat >&2) | extract_ip_report)
|
||||
|
||||
# 格式化结果
|
||||
echo -e "${YELLOW}此报告由Nodeloc_VPS_自动脚本测试生成...${NC}"
|
||||
format_results
|
||||
|
||||
echo "Debug: IP质量结果长度: ${#ip_quality_result}" >> /root/debug.log
|
||||
}
|
||||
|
||||
# 提取IP质量报告
|
||||
extract_ip_report() {
|
||||
awk '/^########################################################################$/,/按回车键返回主菜单.../' |
|
||||
sed '/按回车键返回主菜单.../d' # 移除"按回车键返回主菜单..."行
|
||||
sed '/按回车键返回主菜单.../d'
|
||||
}
|
||||
|
||||
# 格式化结果为 Markdown
|
||||
format_results() {
|
||||
echo "Debug: IP质量结果长度: ${#ip_quality_result}" >> /root/debug.log
|
||||
echo "Debug: IP质量结果前100字符: ${ip_quality_result:0:100}" >> /root/debug.log
|
||||
|
||||
result="[tabs]
|
||||
[tab=\"IP质量\"]
|
||||
\`\`\`
|
||||
@ -164,8 +173,8 @@ $ip_quality_result
|
||||
\`\`\`
|
||||
[/tab]
|
||||
[/tabs]"
|
||||
echo "$result" > results.md
|
||||
echo -e "${GREEN}结果已保存到 results.md 文件中。${NC}"
|
||||
echo "$result" > /root/results.md
|
||||
echo -e "${GREEN}结果已保存到 /root/results.md 文件中。${NC}"
|
||||
}
|
||||
|
||||
# 复制结果到剪贴板
|
||||
|
Loading…
Reference in New Issue
Block a user