mirror of
https://github.com/everett7623/nodeloc_vps_test.git
synced 2024-11-14 03:55:19 +00:00
Update nodeloc_vps_autotest_ip.sh
This commit is contained in:
parent
90d7427bc1
commit
97b9404d14
@ -116,11 +116,10 @@ declare -a test_results
|
|||||||
ip_process_output() {
|
ip_process_output() {
|
||||||
local input="$1"
|
local input="$1"
|
||||||
local start_line=$(echo "$input" | grep -n '正在检测黑名单数据库' | tail -n 1 | cut -d ':' -f 1)
|
local start_line=$(echo "$input" | grep -n '正在检测黑名单数据库' | tail -n 1 | cut -d ':' -f 1)
|
||||||
start_line=$((start_line + 1)) # 移动到下一行
|
|
||||||
local end_line=$(echo "$input" | grep -n '按回车键返回主菜单' | head -n 1 | cut -d ':' -f 1)
|
local end_line=$(echo "$input" | grep -n '按回车键返回主菜单' | head -n 1 | cut -d ':' -f 1)
|
||||||
|
|
||||||
if [ -n "$start_line" ] && [ -n "$end_line" ]; then
|
if [ -n "$start_line" ] && [ -n "$end_line" ]; then
|
||||||
tail -n +"$start_line" <<< "$input" | head -n $(($end_line - $start_line)) | sed -E 's/\x1b\[[0-9;]*[a-zA-Z]//g'
|
tail -n +"$start_line" <<< "$input" | head -n $(($end_line - $start_line + 1)) | sed -E 's/\x1b\[[0-9;]*[a-zA-Z]//g'
|
||||||
elif [ -n "$start_line" ]; then
|
elif [ -n "$start_line" ]; then
|
||||||
tail -n +"$start_line" <<< "$input" | sed -E 's/\x1b\[[0-9;]*[a-zA-Z]//g'
|
tail -n +"$start_line" <<< "$input" | sed -E 's/\x1b\[[0-9;]*[a-zA-Z]//g'
|
||||||
else
|
else
|
||||||
|
Loading…
Reference in New Issue
Block a user