Update port.sh

dependabot/github_actions/actions/checkout-3.1.0
fscarmen 4 years ago committed by GitHub
parent 6103e70b8a
commit f9584bd086
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 4
      port.sh

@ -9,9 +9,9 @@ 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 20
sleep 10
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"))
for ((i=0;i<${#AREA[@]};i++)); do echo -e "$(eval echo "\$${AREA[0]}")\t $(eval echo "\$${RESULT[0]}")"; done
for ((i=0;i<${#AREA[@]};i++)); do echo -e "$(eval echo "\$${AREA[i]}")\t $(eval echo "\$${RESULT[i]}")"; done

Loading…
Cancel
Save