From 75343464f768250b5493218c6755ffdae461d963 Mon Sep 17 00:00:00 2001 From: fscarmen <62703343+fscarmen@users.noreply.github.com> Date: Sun, 19 Jun 2022 23:31:59 +0800 Subject: [PATCH] Update port_pure.sh --- port_pure.sh | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/port_pure.sh b/port_pure.sh index 8c8b63b..8426fae 100644 --- a/port_pure.sh +++ b/port_pure.sh @@ -10,14 +10,15 @@ result0='打开'; result1='关闭' TOKEN=$(wget -qO- https://tcp$STACK.ping.pe/$ip | grep 'document.cookie' | sed "s/.*document.cookie=\"\([^;]\{1,\}\).*/\1/g") STREAM_ID=$(wget -qO- --header="cookie: $TOKEN" https://tcp$STACK.ping.pe/$ip | grep 'stream_id =' | cut -d \' -f2) sleep 3 -until [[ $ALL =~ 'TW_1' ]]; do +until [[ ${#AREA[@]} = 10 ]]; do + unset ALL AREA RESULT sleep 2 ((j++)) || true [[ $j = 5 ]] && break ALL=$(wget -qO- --header="cookie: $TOKEN" https://tcp$STACK.ping.pe/ajax_getPingResults_v2.php?stream_id=$STREAM_ID) + AREA=($(echo $ALL | python3 -m json.tool | grep CN_ | cut -d \" -f4)) + RESULT=($(echo $ALL | python3 -m json.tool | grep -A 2 CN_ | grep result | sed "s#[\":, ]##g")) done -AREA=($(echo $ALL | python3 -m json.tool | grep CN_ | cut -d \" -f4)) -RESULT=($(echo $ALL | python3 -m json.tool | grep -A 2 CN_ | grep result | sed "s#[\":, ]##g")) echo -e "地方 ISP 状态" for ((i=0;i<${#AREA[@]};i++)); do echo -e "$(eval echo "\$${AREA[i]}") $(eval echo "\$${RESULT[i]}")"; done