mirror of
https://github.com/everett7623/nodeloc_vps_test.git
synced 2024-11-10 10:05:18 +00:00
Update nodeloc_vps_autotest_ip.sh
This commit is contained in:
parent
7fcdd97ca4
commit
2992f1d726
@ -140,21 +140,38 @@ show_welcome() {
|
||||
touch /root/results.md
|
||||
chmod 777 /root/results.md
|
||||
|
||||
#获取IP输出结果
|
||||
extract_ip_report() {
|
||||
# 执行原始脚本并捕获输出
|
||||
local full_output=$(bash <(curl -Ls IP.Check.Place))
|
||||
|
||||
# 从输出中提取我们需要的部分
|
||||
echo "$full_output" | awk '/########################################################################/,/按回车键返回主菜单.../' | sed '/按回车键返回主菜单.../d'
|
||||
}
|
||||
#运行测试
|
||||
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)")
|
||||
ip_quality_result=$(extract_ip_report)
|
||||
|
||||
# 格式化结果
|
||||
echo -e "${YELLOW}此报告由Nodeloc_VPS_自动脚本测试生成...${NC}"
|
||||
format_results
|
||||
|
||||
echo "Debug: IP质量结果长度: ${#ip_quality_result}" >> /root/debug.log
|
||||
echo "Debug: IP质量结果前300字符: ${ip_quality_result:0:300}" >> /root/debug.log
|
||||
}
|
||||
|
||||
# 格式化结果为 Markdown
|
||||
format_results() {
|
||||
result="[tabs]
|
||||
echo "Debug: IP质量结果长度: ${#ip_quality_result}" >> /root/debug.log
|
||||
echo "Debug: IP质量结果前300字符: ${ip_quality_result:0:300}" >> /root/debug.log
|
||||
|
||||
# 移除ANSI颜色代码
|
||||
ip_quality_result=$(echo "$ip_quality_result" | sed 's/\x1b\[[0-9;]*m//g')
|
||||
|
||||
result="[tabs]
|
||||
[tab=\"IP质量\"]
|
||||
\`\`\`
|
||||
$ip_quality_result
|
||||
|
Loading…
Reference in New Issue
Block a user