mirror of https://gitlab.com/rwkgyg/CFwarp.git
Update CFwarp1.sh
This commit is contained in:
parent
3b36f4b858
commit
7fef081b10
21
CFwarp1.sh
21
CFwarp1.sh
|
@ -111,18 +111,24 @@ wgcfv4=$(curl -s4m6 https://www.cloudflare.com/cdn-cgi/trace -k | grep warp | cu
|
||||||
ShowWGCF(){
|
ShowWGCF(){
|
||||||
UA_Browser="Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.87 Safari/537.36"
|
UA_Browser="Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.87 Safari/537.36"
|
||||||
v4v6
|
v4v6
|
||||||
|
|
||||||
isp4=`curl -s --user-agent "${UA_Browser}" https://api.ip.sb/geoip/$v4 -k | awk -F "isp" '{print $2}' | awk -F "offset" '{print $1}' | sed "s/[,\":]//g"`
|
|
||||||
isp6=`curl -s --user-agent "${UA_Browser}" https://api.ip.sb/geoip/$v6 -k | awk -F "isp" '{print $2}' | awk -F "offset" '{print $1}' | sed "s/[,\":]//g"`
|
|
||||||
|
|
||||||
warppflow=$((`grep -oP '"quota":\K\d+' <<< $(curl -s "https://api.cloudflareclient.com/v0a884/reg/$(grep 'device_id' /etc/wireguard/wgcf-account.toml 2>/dev/null | cut -d \' -f2)" -H "User-Agent: okhttp/3.12.1" -H "Authorization: Bearer $(grep 'access_token' /etc/wireguard/wgcf-account.toml 2>/dev/null | cut -d \' -f2)")`))
|
warppflow=$((`grep -oP '"quota":\K\d+' <<< $(curl -s "https://api.cloudflareclient.com/v0a884/reg/$(grep 'device_id' /etc/wireguard/wgcf-account.toml 2>/dev/null | cut -d \' -f2)" -H "User-Agent: okhttp/3.12.1" -H "Authorization: Bearer $(grep 'access_token' /etc/wireguard/wgcf-account.toml 2>/dev/null | cut -d \' -f2)")`))
|
||||||
flow=`echo "scale=2; $warppflow/1000000000" | bc`
|
flow=`echo "scale=2; $warppflow/1000000000" | bc`
|
||||||
[[ -e /etc/wireguard/wgcf+p.log ]] && cfplus="WARP+普通账户(有限WARP+流量:$flow GB),设备名称:$(grep -s 'Device name' /etc/wireguard/wgcf+p.log | awk '{ print $NF }')" || cfplus="WARP+Teams账户(无限WARP+流量)"
|
[[ -e /etc/wireguard/wgcf+p.log ]] && cfplus="WARP+普通账户(有限WARP+流量:$flow GB),设备名称:$(grep -s 'Device name' /etc/wireguard/wgcf+p.log | awk '{ print $NF }')" || cfplus="WARP+Teams账户(无限WARP+流量)"
|
||||||
if [[ -n $v4 ]]; then
|
if [[ -n $v4 ]]; then
|
||||||
wgcfv4=$(curl -s4 https://www.cloudflare.com/cdn-cgi/trace -k | grep warp | cut -d= -f2)
|
wgcfv4=$(curl -s4 https://www.cloudflare.com/cdn-cgi/trace -k | grep warp | cut -d= -f2)
|
||||||
nonf=$(curl -s --user-agent "${UA_Browser}" http://ip-api.com/json/$v4?lang=zh-CN -k | cut -f2 -d"," | cut -f4 -d '"')
|
isp4a=`curl -sm6 --user-agent "${UA_Browser}" http://ip-api.com/json/$v4?lang=zh-CN -k | cut -f12 -d"," | cut -f4 -d '"'`
|
||||||
|
isp4b=`curl -sm6 --user-agent "${UA_Browser}" https://api.ip.sb/geoip/$v4 -k | awk -F "isp" '{print $2}' | awk -F "offset" '{print $1}' | sed "s/[,\":]//g"`
|
||||||
|
[[ -n $isp4a ]] && isp4=$isp6a || isp4=$isp4b
|
||||||
|
nonf=$(curl -sm6 --user-agent "${UA_Browser}" http://ip-api.com/json/$v4?lang=zh-CN -k | cut -f2 -d"," | cut -f4 -d '"')
|
||||||
sunf=$(./nf | awk '{print $1}' | sed -n '4p')
|
sunf=$(./nf | awk '{print $1}' | sed -n '4p')
|
||||||
[[ -n $sunf ]] && country=$sunf || country=$nonf
|
snnf=$(curl -s4m6 ip.p3terx.com -k | sed -n 2p | awk '{print $3}')
|
||||||
|
if [[ -n $sunf ]]; then
|
||||||
|
country=$sunf
|
||||||
|
elif [[ -z $sunf && -n $nonf ]]; then
|
||||||
|
country=$nonf
|
||||||
|
else
|
||||||
|
country=$snnf
|
||||||
|
fi
|
||||||
case ${wgcfv4} in
|
case ${wgcfv4} in
|
||||||
plus)
|
plus)
|
||||||
WARPIPv4Status=$(white "WARP+状态:\c" ; rred "运行中,$cfplus" ; white " 服务商 Cloudflare 获取IPV4地址:\c" ; rred "$v4 $country" ; white " 奈飞NF解锁情况:\c" ; rred "$(./nf | awk '{print $1}' | sed -n '3p')");;
|
WARPIPv4Status=$(white "WARP+状态:\c" ; rred "运行中,$cfplus" ; white " 服务商 Cloudflare 获取IPV4地址:\c" ; rred "$v4 $country" ; white " 奈飞NF解锁情况:\c" ; rred "$(./nf | awk '{print $1}' | sed -n '3p')");;
|
||||||
|
@ -136,6 +142,9 @@ WARPIPv4Status=$(white "IPV4状态:\c" ; red "不存在IPV4地址 ")
|
||||||
fi
|
fi
|
||||||
if [[ -n $v6 ]]; then
|
if [[ -n $v6 ]]; then
|
||||||
wgcfv6=$(curl -s6 https://www.cloudflare.com/cdn-cgi/trace -k | grep warp | cut -d= -f2)
|
wgcfv6=$(curl -s6 https://www.cloudflare.com/cdn-cgi/trace -k | grep warp | cut -d= -f2)
|
||||||
|
isp6a=`curl -sm6 --user-agent "${UA_Browser}" http://ip-api.com/json/$v6?lang=zh-CN -k | cut -f12 -d"," | cut -f4 -d '"'`
|
||||||
|
isp6b=`curl -sm6 --user-agent "${UA_Browser}" https://api.ip.sb/geoip/$v6 -k | awk -F "isp" '{print $2}' | awk -F "offset" '{print $1}' | sed "s/[,\":]//g"`
|
||||||
|
[[ -n $isp6a ]] && isp6=$isp6a || isp6=$isp6b
|
||||||
nonf=$(curl -sm6 --user-agent "${UA_Browser}" http://ip-api.com/json/$v6?lang=zh-CN -k | cut -f2 -d"," | cut -f4 -d '"')
|
nonf=$(curl -sm6 --user-agent "${UA_Browser}" http://ip-api.com/json/$v6?lang=zh-CN -k | cut -f2 -d"," | cut -f4 -d '"')
|
||||||
sunf=$(./nf | awk '{print $1}' | sed -n '8p')
|
sunf=$(./nf | awk '{print $1}' | sed -n '8p')
|
||||||
snnf=$(curl -s6m6 ip.p3terx.com -k | sed -n 2p | awk '{print $3}')
|
snnf=$(curl -s6m6 ip.p3terx.com -k | sed -n 2p | awk '{print $3}')
|
||||||
|
|
Loading…
Reference in New Issue