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
17f9056f24
commit
efdf366814
@ -140,13 +140,33 @@ show_welcome() {
|
||||
touch /root/results.md
|
||||
chmod 666 /root/results.md
|
||||
|
||||
# 提取IP质量报告
|
||||
extract_ip_report() {
|
||||
local script_content=$(curl -sL IP.Check.Place)
|
||||
local extracted_content=""
|
||||
|
||||
# 提取 show_head 函数内容
|
||||
local show_head_content=$(echo "$script_content" | sed -n '/^show_head()/,/^}/p')
|
||||
extracted_content+="$(eval "$show_head_content"; show_head)"
|
||||
|
||||
# 提取 show_basic 函数内容
|
||||
local show_basic_content=$(echo "$script_content" | sed -n '/^show_basic()/,/^}/p')
|
||||
extracted_content+="$(eval "$show_basic_content"; show_basic)"
|
||||
|
||||
# 提取 show_type 函数内容
|
||||
local show_type_content=$(echo "$script_content" | sed -n '/^show_type()/,/^}/p')
|
||||
extracted_content+="$(eval "$show_type_content"; show_type)"
|
||||
|
||||
echo "$extracted_content"
|
||||
}
|
||||
|
||||
# 运行所有测试
|
||||
run_all_tests() {
|
||||
echo -e "${RED}开始测试,测试时间较长,请耐心等待...${NC}"
|
||||
|
||||
# IP质量
|
||||
echo -e "运行${YELLOW}IP质量测试...${NC}"
|
||||
ip_quality_result=$(bash <(curl -Ls IP.Check.Place) | tee >(cat >&2) | extract_ip_report)
|
||||
ip_quality_result=$(extract_ip_report)
|
||||
|
||||
# 格式化结果
|
||||
echo -e "${YELLOW}此报告由Nodeloc_VPS_自动脚本测试生成...${NC}"
|
||||
@ -155,12 +175,6 @@ run_all_tests() {
|
||||
echo "Debug: IP质量结果长度: ${#ip_quality_result}" >> /root/debug.log
|
||||
}
|
||||
|
||||
# 提取IP质量报告
|
||||
extract_ip_report() {
|
||||
awk '/^########################################################################$/,/按回车键返回主菜单.../' |
|
||||
sed '/按回车键返回主菜单.../d'
|
||||
}
|
||||
|
||||
# 格式化结果为 Markdown
|
||||
format_results() {
|
||||
echo "Debug: IP质量结果长度: ${#ip_quality_result}" >> /root/debug.log
|
||||
|
Loading…
Reference in New Issue
Block a user