Update port_pure.sh

dependabot/github_actions/actions/checkout-3.1.0
fscarmen 4 years ago committed by GitHub
parent 10d9fddc46
commit 75343464f7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 7
      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

Loading…
Cancel
Save