From 4e6db2036f81f637e1aad96099de3b7d6a6ed357 Mon Sep 17 00:00:00 2001 From: fscarmen <62703343+fscarmen@users.noreply.github.com> Date: Mon, 20 Jun 2022 14:01:31 +0800 Subject: [PATCH] Update port_pure.sh --- port_pure.sh | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/port_pure.sh b/port_pure.sh index c2a8837..ee3aaaf 100644 --- a/port_pure.sh +++ b/port_pure.sh @@ -5,7 +5,7 @@ ip=$1 [[ ! $ip =~ '.' ]] && STACK='6' NODE_ID=('CN_35' 'CN_40' 'CN_50' 'CN_90' 'CN_103' 'CN_104' 'CN_105' 'CN_150' 'CN_160' 'CN_210') -NODE_ZH=('深圳 阿里云' '北京 阿里云' '北京 腾讯云' '泉州 电信CN2' '江苏 电信' '江苏 移动' '江苏 联通' '杭州 阿里云' '青岛 阿里云' '上海 阿里云') +NODE_ZH=('深圳 | 阿里云' '北京 | 阿里云' '北京 | 腾讯云' '泉州 | 电信CN2' '江苏 | 电信' '江苏 | 移动' '江苏 | 联通' '杭州 | 阿里云' '青岛 | 阿里云' '上海 | 阿里云') result0='✅'; result1='📛' TOKEN=$(wget -qO- https://tcp$STACK.ping.pe/$ip | grep 'document.cookie' | sed "s/.*document.cookie=\"\([^;]\{1,\}\).*/\1/g") @@ -19,9 +19,11 @@ until [[ $ALL =~ 'TW_1' ]]; do ALL=$(wget -qO- --header="cookie: $TOKEN" https://tcp$STACK.ping.pe/ajax_getPingResults_v2.php?stream_id=$STREAM_ID) done -printf "%-10s\t%-10s\t%-10s\n" 状态 地方 ISP +echo -e "| 状态 | 地方 | ISP |" +echo -e "|-----|-----|-----|" +https://stackoverflow.com/questions/49345960/how-do-i-send-tables-with-telegram-bot-api for ((i=0;i<${#NODE_ID[@]};i++)); do RESULT[i]=$(echo $ALL | python3 -m json.tool | grep -A 2 ${NODE_ID[i]} | grep result | sed "s#[\":, ]##g") RESULT[i]=${RESULT[i]:-'result1'} - printf "%-10s\t%-10s\t%-10s\n" $(eval echo "\$${RESULT[i]}") ${NODE_ZH[i]} + echo -e "| $(eval echo "\$${RESULT[i]}") | ${NODE_ZH[i]} |" done