Update CFwarp1.sh

This commit is contained in:
甬哥侃侃侃ygkkk 2022-09-22 05:53:59 +00:00
parent fbc97c17bd
commit bcc423c8bc
1 changed files with 14 additions and 10 deletions

View File

@ -111,39 +111,43 @@ 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"` 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"` 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 -s4m6 ip.p3terx.com -k | sed -n 2p | awk '{print $3}') nonf=$(curl -s --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 $nonf && -n $sunf ]] && contry=$sunf || contry=$nonf [[ -n $sunf ]] && country=$sunf || country=$nonf
case ${wgcfv4} in case ${wgcfv4} in
plus) plus)
WARPIPv4Status=$(white "WARP+状态:\c" ; rred "运行中,$cfplus" ; white " 服务商 Cloudflare 获取IPV4地址\c" ; rred "$v4 $contry" ; 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')");;
on) on)
WARPIPv4Status=$(white "WARP状态\c" ; green "运行中WARP普通账户(无限WARP流量)" ; white " 服务商 Cloudflare 获取IPV4地址\c" ; green "$v4 $contry" ; white " 奈飞NF解锁情况\c" ; green "$(./nf | awk '{print $1}' | sed -n '3p')");; WARPIPv4Status=$(white "WARP状态\c" ; green "运行中WARP普通账户(无限WARP流量)" ; white " 服务商 Cloudflare 获取IPV4地址\c" ; green "$v4 $country" ; white " 奈飞NF解锁情况\c" ; green "$(./nf | awk '{print $1}' | sed -n '3p')");;
off) off)
WARPIPv4Status=$(white "WARP状态\c" ; yellow "关闭中" ; white " 服务商 $isp4 获取IPV4地址\c" ; yellow "$v4 $contry" ; white " 奈飞NF解锁情况\c" ; yellow "$(./nf | awk '{print $1}' | sed -n '3p')");; WARPIPv4Status=$(white "WARP状态\c" ; yellow "关闭中" ; white " 服务商 $isp4 获取IPV4地址\c" ; yellow "$v4 $country" ; white " 奈飞NF解锁情况\c" ; yellow "$(./nf | awk '{print $1}' | sed -n '3p')");;
esac esac
else else
WARPIPv4Status=$(white "IPV4状态\c" ; red "不存在IPV4地址 ") 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)
nonf=$(curl -s6m6 ip.p3terx.com -k | sed -n 2p | awk '{print $3}') nonf=$(curl -s --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')
[[ -n $nonf && -n $sunf ]] && contry=$sunf || contry=$nonf [[ -n $sunf ]] && country=$sunf || country=$nonf
case ${wgcfv6} in case ${wgcfv6} in
plus) plus)
WARPIPv6Status=$(white "WARP+状态:\c" ; rred "运行中,$cfplus" ; white " 服务商 Cloudflare 获取IPV6地址\c" ; rred "$v6 $contry" ; white " 奈飞NF解锁情况\c" ; rred "$(./nf | awk '{print $1}' | sed -n '7p')");; WARPIPv6Status=$(white "WARP+状态:\c" ; rred "运行中,$cfplus" ; white " 服务商 Cloudflare 获取IPV6地址\c" ; rred "$v6 $country" ; white " 奈飞NF解锁情况\c" ; rred "$(./nf | awk '{print $1}' | sed -n '7p')");;
on) on)
WARPIPv6Status=$(white "WARP状态\c" ; green "运行中WARP普通账户(无限WARP流量)" ; white " 服务商 Cloudflare 获取IPV6地址\c" ; green "$v6 $contry" ; white " 奈飞NF解锁情况\c" ; green "$(./nf | awk '{print $1}' | sed -n '7p')");; WARPIPv6Status=$(white "WARP状态\c" ; green "运行中WARP普通账户(无限WARP流量)" ; white " 服务商 Cloudflare 获取IPV6地址\c" ; green "$v6 $country" ; white " 奈飞NF解锁情况\c" ; green "$(./nf | awk '{print $1}' | sed -n '7p')");;
off) off)
WARPIPv6Status=$(white "WARP状态\c" ; yellow "关闭中" ; white " 服务商 $isp6 获取IPV6地址\c" ; yellow "$v6 $contry" ; white " 奈飞NF解锁情况\c" ; yellow "$(./nf | awk '{print $1}' | sed -n '7p')");; WARPIPv6Status=$(white "WARP状态\c" ; yellow "关闭中" ; white " 服务商 $isp6 获取IPV6地址\c" ; yellow "$v6 $country" ; white " 奈飞NF解锁情况\c" ; yellow "$(./nf | awk '{print $1}' | sed -n '7p')");;
esac esac
else else
WARPIPv6Status=$(white "IPV6状态\c" ; red "不存在IPV6地址 ") WARPIPv6Status=$(white "IPV6状态\c" ; red "不存在IPV6地址 ")