diff --git a/nodeloc_vps_autotest_ip.sh b/nodeloc_vps_autotest_ip.sh index 8df154f..ea246d3 100644 --- a/nodeloc_vps_autotest_ip.sh +++ b/nodeloc_vps_autotest_ip.sh @@ -146,7 +146,11 @@ extract_ip_report() { local full_output=$(bash <(curl -Ls IP.Check.Place)) # 从输出中提取我们需要的部分,保留ANSI颜色代码和分隔符 - echo "$full_output" | sed -n '/^########################################################################$/,/按回车键返回主菜单.../{/按回车键返回主菜单.../!p}' + echo "$full_output" | awk ' + /^########################################################################$/ {flag=1} + flag && !/按回车键返回主菜单.../ {print} + /按回车键返回主菜单.../ {flag=0} + ' } #运行测试