mirror of https://gitlab.com/rwkgyg/CFwarp.git
Update CFwarp.sh
This commit is contained in:
parent
2bdd826692
commit
c47f66137f
163
CFwarp.sh
163
CFwarp.sh
|
@ -1,7 +1,7 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
export PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~/bin
|
export PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~/bin
|
||||||
export LANG=en_US.UTF-8
|
export LANG=en_US.UTF-8
|
||||||
wpygV="23.3.14 V 0.9.5 "
|
wpygV="23.3.17 V 0.9.6 "
|
||||||
remoteV=`wget -qO- https://gitlab.com/rwkgyg/CFwarp/raw/main/CFwarp.sh | sed -n 4p | cut -d '"' -f 2`
|
remoteV=`wget -qO- https://gitlab.com/rwkgyg/CFwarp/raw/main/CFwarp.sh | sed -n 4p | cut -d '"' -f 2`
|
||||||
chmod +x /root/CFwarp.sh
|
chmod +x /root/CFwarp.sh
|
||||||
red='\033[0;31m'
|
red='\033[0;31m'
|
||||||
|
@ -85,12 +85,12 @@ fi
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ ! -f /root/nf || ! -s /root/nf ]]; then
|
#if [[ ! -f /root/nf || ! -s /root/nf ]]; then
|
||||||
cpujg
|
#cpujg
|
||||||
wget -O nf https://gitlab.com/rwkgyg/CFwarp/-/raw/main/nf_linux_${cpu}
|
#wget -O nf https://gitlab.com/rwkgyg/CFwarp/-/raw/main/nf_linux_${cpu}
|
||||||
#wget -O nf https://raw.githubusercontent.com/rkygogo/netflix-verify/main/nf_linux_$cpu
|
#wget -O nf https://raw.githubusercontent.com/rkygogo/netflix-verify/main/nf_linux_$cpu
|
||||||
chmod +x nf
|
#chmod +x nf
|
||||||
fi
|
#fi
|
||||||
|
|
||||||
[[ $(type -P yum) ]] && yumapt='yum -y' || yumapt='apt -y'
|
[[ $(type -P yum) ]] && yumapt='yum -y' || yumapt='apt -y'
|
||||||
[[ $(type -P curl) ]] || (yellow "检测到curl未安装,升级安装中" && $yumapt update;$yumapt install curl)
|
[[ $(type -P curl) ]] || (yellow "检测到curl未安装,升级安装中" && $yumapt update;$yumapt install curl)
|
||||||
|
@ -98,6 +98,54 @@ fi
|
||||||
[[ ! $(type -P qrencode) ]] && ($yumapt update;$yumapt install qrencode)
|
[[ ! $(type -P qrencode) ]] && ($yumapt update;$yumapt install qrencode)
|
||||||
[[ ! $(type -P python3) ]] && (yellow "检测到python3未安装,升级安装中" && $yumapt update;$yumapt install python3)
|
[[ ! $(type -P python3) ]] && (yellow "检测到python3未安装,升级安装中" && $yumapt update;$yumapt install python3)
|
||||||
|
|
||||||
|
nf4() {
|
||||||
|
result=`curl --connect-timeout 5 -4sSL "https://www.netflix.com/" 2>&1`
|
||||||
|
[ "$result" == "Not Available" ] && NF="死心吧,Netflix不服务当前IP地区" && return
|
||||||
|
[[ "$result" == "curl"* ]] && NF="错误,无法连接到Netflix官网" && return
|
||||||
|
result=`curl -4sL "https://www.netflix.com/title/80018499" 2>&1`
|
||||||
|
[[ "$result" == *"page-404"* || "$result" == *"NSEZ-403"* ]] && NF="杯具,当前IP不能看Netflix" && return
|
||||||
|
result1=`curl -4sL "https://www.netflix.com/title/70143836" 2>&1`
|
||||||
|
result2=`curl -4sL "https://www.netflix.com/title/80027042" 2>&1`
|
||||||
|
result3=`curl -4sL "https://www.netflix.com/title/70140425" 2>&1`
|
||||||
|
result4=`curl -4sL "https://www.netflix.com/title/70283261" 2>&1`
|
||||||
|
result5=`curl -4sL "https://www.netflix.com/title/70143860" 2>&1`
|
||||||
|
result6=`curl -4sL "https://www.netflix.com/title/70202589" 2>&1`
|
||||||
|
[[ "$result1" == *"page-404"* && "$result2" == *"page-404"* && "$result3" == *"page-404"* && "$result4" == *"page-404"* && "$result5" == *"page-404"* && "$result6" == *"page-404"* ]] && NF="遗憾,当前IP仅可观看Netflix自制剧" && return
|
||||||
|
NF="恭喜,当前IP支持观看Netflix非自制剧" && return
|
||||||
|
}
|
||||||
|
|
||||||
|
nf6() {
|
||||||
|
result=`curl --connect-timeout 5 -6sSL "https://www.netflix.com/" 2>&1`
|
||||||
|
[ "$result" == "Not Available" ] && NF="死心吧,Netflix不服务当前IP地区" && return
|
||||||
|
[[ "$result" == "curl"* ]] && NF="错误,无法连接到Netflix官网" && return
|
||||||
|
result=`curl -6sL "https://www.netflix.com/title/80018499" 2>&1`
|
||||||
|
[[ "$result" == *"page-404"* || "$result" == *"NSEZ-403"* ]] && NF="杯具,当前IP不能看Netflix" && return
|
||||||
|
result1=`curl -6sL "https://www.netflix.com/title/70143836" 2>&1`
|
||||||
|
result2=`curl -6sL "https://www.netflix.com/title/80027042" 2>&1`
|
||||||
|
result3=`curl -6sL "https://www.netflix.com/title/70140425" 2>&1`
|
||||||
|
result4=`curl -6sL "https://www.netflix.com/title/70283261" 2>&1`
|
||||||
|
result5=`curl -6sL "https://www.netflix.com/title/70143860" 2>&1`
|
||||||
|
result6=`curl -6sL "https://www.netflix.com/title/70202589" 2>&1`
|
||||||
|
[[ "$result1" == *"page-404"* && "$result2" == *"page-404"* && "$result3" == *"page-404"* && "$result4" == *"page-404"* && "$result5" == *"page-404"* && "$result6" == *"page-404"* ]] && NF="遗憾,当前IP仅可观看Netflix自制剧" && return
|
||||||
|
NF="恭喜,当前IP支持观看Netflix非自制剧" && return
|
||||||
|
}
|
||||||
|
|
||||||
|
nfs5() {
|
||||||
|
result=`curl -sx socks5h://localhost:$mport --connect-timeout 5 -4sSL "https://www.netflix.com/" 2>&1`
|
||||||
|
[ "$result" == "Not Available" ] && NF="死心吧,Netflix不服务当前IP地区" && return
|
||||||
|
[[ "$result" == "curl"* ]] && NF="错误,无法连接到Netflix官网" && return
|
||||||
|
result=`curl -sx socks5h://localhost:$mport -4sL "https://www.netflix.com/title/80018499" 2>&1`
|
||||||
|
[[ "$result" == *"page-404"* || "$result" == *"NSEZ-403"* ]] && NF="杯具,当前IP不能看Netflix" && return
|
||||||
|
result1=`curl -sx socks5h://localhost:$mport -4sL "https://www.netflix.com/title/70143836" 2>&1`
|
||||||
|
result2=`curl -sx socks5h://localhost:$mport -4sL "https://www.netflix.com/title/80027042" 2>&1`
|
||||||
|
result3=`curl -sx socks5h://localhost:$mport -4sL "https://www.netflix.com/title/70140425" 2>&1`
|
||||||
|
result4=`curl -sx socks5h://localhost:$mport -4sL "https://www.netflix.com/title/70283261" 2>&1`
|
||||||
|
result5=`curl -sx socks5h://localhost:$mport -4sL "https://www.netflix.com/title/70143860" 2>&1`
|
||||||
|
result6=`curl -sx socks5h://localhost:$mport -4sL "https://www.netflix.com/title/70202589" 2>&1`
|
||||||
|
[[ "$result1" == *"page-404"* && "$result2" == *"page-404"* && "$result3" == *"page-404"* && "$result4" == *"page-404"* && "$result5" == *"page-404"* && "$result6" == *"page-404"* ]] && NF="遗憾,当前IP仅可观看Netflix自制剧" && return
|
||||||
|
NF="恭喜,当前IP支持观看Netflix非自制剧" && return
|
||||||
|
}
|
||||||
|
|
||||||
v4v6(){
|
v4v6(){
|
||||||
v4=$(curl -s4m6 ip.sb -k)
|
v4=$(curl -s4m6 ip.sb -k)
|
||||||
v6=$(curl -s6m6 ip.sb -k)
|
v6=$(curl -s6m6 ip.sb -k)
|
||||||
|
@ -315,27 +363,22 @@ ShowSOCKS5(){
|
||||||
if [[ $(systemctl is-active warp-svc) = active ]]; then
|
if [[ $(systemctl is-active warp-svc) = active ]]; then
|
||||||
mport=`warp-cli --accept-tos settings 2>/dev/null | grep 'WarpProxy on port' | awk -F "port " '{print $2}'`
|
mport=`warp-cli --accept-tos settings 2>/dev/null | grep 'WarpProxy on port' | awk -F "port " '{print $2}'`
|
||||||
s5ip=`curl -sx socks5h://localhost:$mport ip.sb -k`
|
s5ip=`curl -sx socks5h://localhost:$mport ip.sb -k`
|
||||||
NF=$(./nf -proxy socks5h://localhost:$mport | awk '{print $1}' | sed -n '3p')
|
nfs5
|
||||||
[[ $(curl -sx socks5h://localhost:$mport https://chat.openai.com/ -I | grep "text/plain") != "" ]] && chat='遗憾,无法访问Chatgpt官网服务' || chat='恭喜,支持访问Chatgpt官网服务'
|
#NF=$(./nf -proxy socks5h://localhost:$mport | awk '{print $1}' | sed -n '3p')
|
||||||
|
[[ $(curl -sx socks5h://localhost:$mport https://chat.openai.com/ -I | grep "text/plain") != "" ]] && chat='遗憾,当前IP无法访问Chatgpt官网服务' || chat='恭喜,当前IP支持访问Chatgpt官网服务'
|
||||||
isp4a=`curl -sx socks5h://localhost:$mport --user-agent "${UA_Browser}" http://ip-api.com/json/$v4?lang=zh-CN -k | cut -f13 -d ":" | cut -f2 -d '"'`
|
isp4a=`curl -sx socks5h://localhost:$mport --user-agent "${UA_Browser}" http://ip-api.com/json/$v4?lang=zh-CN -k | cut -f13 -d ":" | cut -f2 -d '"'`
|
||||||
isp4b=`curl -sx socks5h://localhost:$mport --user-agent "${UA_Browser}" https://api.ip.sb/geoip/$v4 -k | awk -F "isp" '{print $2}' | awk -F "offset" '{print $1}' | sed "s/[,\":]//g"`
|
isp4b=`curl -sx socks5h://localhost:$mport --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=$isp4a || isp4=$isp4b
|
[[ -n $isp4a ]] && isp4=$isp4a || isp4=$isp4b
|
||||||
nonf=$(curl -sx socks5h://localhost:$mport --user-agent "${UA_Browser}" http://ip-api.com/json/$v4?lang=zh-CN -k | cut -f2 -d"," | cut -f4 -d '"')
|
nonf=$(curl -sx socks5h://localhost:$mport --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')
|
||||||
snnf=$(curl -sx socks5h://localhost:$mport ip.p3terx.com -k | sed -n 2p | awk '{print $3}')
|
#snnf=$(curl -sx socks5h://localhost:$mport ip.p3terx.com -k | sed -n 2p | awk '{print $3}')
|
||||||
if [[ -n $sunf ]]; then
|
|
||||||
country=$sunf
|
|
||||||
elif [[ -z $sunf && -n $nonf ]]; then
|
|
||||||
country=$nonf
|
country=$nonf
|
||||||
else
|
|
||||||
country=$snnf
|
|
||||||
fi
|
|
||||||
socks5=$(curl -sx socks5h://localhost:$mport www.cloudflare.com/cdn-cgi/trace -k --connect-timeout 2 | grep warp | cut -d= -f2)
|
socks5=$(curl -sx socks5h://localhost:$mport www.cloudflare.com/cdn-cgi/trace -k --connect-timeout 2 | grep warp | cut -d= -f2)
|
||||||
case ${socks5} in
|
case ${socks5} in
|
||||||
plus)
|
plus)
|
||||||
S5Status=$(white "Socks5 WARP+状态:\c" ; rred "运行中,WARP+普通账户(剩余WARP+流量:$((`warp-cli --accept-tos account | grep Quota | awk '{ print $(NF) }'`/1000000000))GiB)" ; white " Socks5 端口:\c" ; rred "$mport" ; white " 服务商 Cloudflare 获取IPV4地址:\c" ; rred "$s5ip $country" ; white " 奈飞NF解锁情况:\c" ; rred "$NF" ; white " Chatgpt支持情况:\c" ; rred "$chat");;
|
S5Status=$(white "Socks5 WARP+状态:\c" ; rred "运行中,WARP+普通账户(剩余WARP+流量:$((`warp-cli --accept-tos account | grep Quota | awk '{ print $(NF) }'`/1000000000))GiB)" ; white " Socks5 端口:\c" ; rred "$mport" ; white " 服务商 Cloudflare 获取IPV4地址:\c" ; rred "$s5ip $country" ; white " 奈飞NF解锁情况:\c" ; rred "$NF" ; white " ChatGPT解锁情况:\c" ; rred "$chat");;
|
||||||
on)
|
on)
|
||||||
S5Status=$(white "Socks5 WARP状态:\c" ; green "运行中,WARP普通账户(无限WARP流量)" ; white " Socks5 端口:\c" ; green "$mport" ; white " 服务商 Cloudflare 获取IPV4地址:\c" ; green "$s5ip $country" ; white " 奈飞NF解锁情况:\c" ; green "$NF" ; white " Chatgpt支持情况:\c" ; green "$chat");;
|
S5Status=$(white "Socks5 WARP状态:\c" ; green "运行中,WARP普通账户(无限WARP流量)" ; white " Socks5 端口:\c" ; green "$mport" ; white " 服务商 Cloudflare 获取IPV4地址:\c" ; green "$s5ip $country" ; white " 奈飞NF解锁情况:\c" ; green "$NF" ; white " ChatGPT解锁情况:\c" ; green "$chat");;
|
||||||
*)
|
*)
|
||||||
S5Status=$(white "Socks5 WARP状态:\c" ; yellow "已安装Socks5-WARP客户端,但端口处于关闭状态")
|
S5Status=$(white "Socks5 WARP状态:\c" ; yellow "已安装Socks5-WARP客户端,但端口处于关闭状态")
|
||||||
esac
|
esac
|
||||||
|
@ -468,55 +511,45 @@ warppflow=$((`grep -oP '"quota":\K\d+' <<< $(curl -sm4 "https://api.cloudflarecl
|
||||||
flow=`echo "scale=2; $warppflow/1000000000" | bc`
|
flow=`echo "scale=2; $warppflow/1000000000" | bc`
|
||||||
[[ -e /usr/local/bin/warpplus.log ]] && cfplus="WARP+普通账户(有限WARP+流量:$flow GB),设备名称:$(sed -n 1p /usr/local/bin/warpplus.log)" || cfplus="WARP+Teams账户(无限WARP+流量)"
|
[[ -e /usr/local/bin/warpplus.log ]] && cfplus="WARP+普通账户(有限WARP+流量:$flow GB),设备名称:$(sed -n 1p /usr/local/bin/warpplus.log)" || cfplus="WARP+Teams账户(无限WARP+流量)"
|
||||||
if [[ -n $v4 ]]; then
|
if [[ -n $v4 ]]; then
|
||||||
[[ $(curl -s4S https://chat.openai.com/ -I | grep "text/plain") != "" ]] && chat='遗憾,无法访问Chatgpt官网服务' || chat='恭喜,支持访问Chatgpt官网服务'
|
nf4
|
||||||
|
[[ $(curl -s4S https://chat.openai.com/ -I | grep "text/plain") != "" ]] && chat='遗憾,当前IP无法访问Chatgpt官网服务' || chat='恭喜,当前IP支持访问Chatgpt官网服务'
|
||||||
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)
|
||||||
isp4a=`curl -sm6 --user-agent "${UA_Browser}" http://ip-api.com/json/$v4?lang=zh-CN -k | cut -f13 -d ":" | cut -f2 -d '"'`
|
isp4a=`curl -sm6 --user-agent "${UA_Browser}" http://ip-api.com/json/$v4?lang=zh-CN -k | cut -f13 -d ":" | cut -f2 -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"`
|
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=$isp4a || isp4=$isp4b
|
[[ -n $isp4a ]] && isp4=$isp4a || 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 '"')
|
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')
|
||||||
snnf=$(curl -s4m6 ip.p3terx.com -k | sed -n 2p | awk '{print $3}')
|
#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
|
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')" ; white " Chatgpt支持情况:\c" ; rred "$chat");;
|
WARPIPv4Status=$(white "WARP+状态:\c" ; rred "运行中,$cfplus" ; white " 服务商 Cloudflare 获取IPV4地址:\c" ; rred "$v4 $country" ; white " 奈飞NF解锁情况:\c" ; rred "$NF" ; white " ChatGPT解锁情况:\c" ; rred "$chat");;
|
||||||
on)
|
on)
|
||||||
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')" ; white " Chatgpt支持情况:\c" ; green "$chat");;
|
WARPIPv4Status=$(white "WARP状态:\c" ; green "运行中,WARP普通账户(无限WARP流量)" ; white " 服务商 Cloudflare 获取IPV4地址:\c" ; green "$v4 $country" ; white " 奈飞NF解锁情况:\c" ; green "$NF" ; white " ChatGPT解锁情况:\c" ; green "$chat");;
|
||||||
off)
|
off)
|
||||||
WARPIPv4Status=$(white "WARP状态:\c" ; yellow "关闭中" ; white " 服务商 $isp4 获取IPV4地址:\c" ; yellow "$v4 $country" ; white " 奈飞NF解锁情况:\c" ; yellow "$(./nf | awk '{print $1}' | sed -n '3p')" ; white " Chatgpt支持情况:\c" ; yellow "$chat");;
|
WARPIPv4Status=$(white "WARP状态:\c" ; yellow "关闭中" ; white " 服务商 $isp4 获取IPV4地址:\c" ; yellow "$v4 $country" ; white " 奈飞NF解锁情况:\c" ; yellow "$NF" ; white " ChatGPT解锁情况:\c" ; yellow "$chat");;
|
||||||
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
|
||||||
[[ $(curl -s6S https://chat.openai.com/ -I | grep "text/plain") != "" ]] && chat='遗憾,无法访问Chatgpt官网服务' || chat='恭喜,支持访问Chatgpt官网服务'
|
nf6
|
||||||
|
[[ $(curl -s6S https://chat.openai.com/ -I | grep "text/plain") != "" ]] && chat='遗憾,当前IP无法访问Chatgpt官网服务' || chat='恭喜,当前IP支持访问Chatgpt官网服务'
|
||||||
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 -f13 -d":" | cut -f2 -d '"'`
|
isp6a=`curl -sm6 --user-agent "${UA_Browser}" http://ip-api.com/json/$v6?lang=zh-CN -k | cut -f13 -d":" | cut -f2 -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"`
|
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
|
[[ -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}')
|
||||||
if [[ -n $sunf ]]; then
|
|
||||||
country=$sunf
|
|
||||||
elif [[ -z $sunf && -n $nonf ]]; then
|
|
||||||
country=$nonf
|
country=$nonf
|
||||||
else
|
|
||||||
country=$snnf
|
|
||||||
fi
|
|
||||||
case ${wgcfv6} in
|
case ${wgcfv6} in
|
||||||
plus)
|
plus)
|
||||||
WARPIPv6Status=$(white "WARP+状态:\c" ; rred "运行中,$cfplus" ; white " 服务商 Cloudflare 获取IPV6地址:\c" ; rred "$v6 $country" ; white " 奈飞NF解锁情况:\c" ; rred "$(./nf | awk '{print $1}' | sed -n '7p')" ; white " Chatgpt支持情况:\c" ; rred "$chat");;
|
WARPIPv6Status=$(white "WARP+状态:\c" ; rred "运行中,$cfplus" ; white " 服务商 Cloudflare 获取IPV6地址:\c" ; rred "$v6 $country" ; white " 奈飞NF解锁情况:\c" ; rred "$NF" ; white " ChatGPT解锁情况:\c" ; rred "$chat");;
|
||||||
on)
|
on)
|
||||||
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')" ; white " Chatgpt支持情况:\c" ; green "$chat");;
|
WARPIPv6Status=$(white "WARP状态:\c" ; green "运行中,WARP普通账户(无限WARP流量)" ; white " 服务商 Cloudflare 获取IPV6地址:\c" ; green "$v6 $country" ; white " 奈飞NF解锁情况:\c" ; green "$NF" ; white " ChatGPT解锁情况:\c" ; green "$chat");;
|
||||||
off)
|
off)
|
||||||
WARPIPv6Status=$(white "WARP状态:\c" ; yellow "关闭中" ; white " 服务商 $isp6 获取IPV6地址:\c" ; yellow "$v6 $country" ; white " 奈飞NF解锁情况:\c" ; yellow "$(./nf | awk '{print $1}' | sed -n '7p')" ; white " Chatgpt支持情况:\c" ; yellow "$chat");;
|
WARPIPv6Status=$(white "WARP状态:\c" ; yellow "关闭中" ; white " 服务商 $isp6 获取IPV6地址:\c" ; yellow "$v6 $country" ; white " 奈飞NF解锁情况:\c" ; yellow "$NF" ; white " ChatGPT解锁情况:\c" ; yellow "$chat");;
|
||||||
esac
|
esac
|
||||||
else
|
else
|
||||||
WARPIPv6Status=$(white "IPV6状态:\c" ; red "不存在IPV6地址 ")
|
WARPIPv6Status=$(white "IPV6状态:\c" ; red "不存在IPV6地址 ")
|
||||||
|
@ -534,8 +567,8 @@ wgo8='sed -i "20 s/^/PostUp = ip -4 rule add from $(ip route get 162.159.192.1 |
|
||||||
|
|
||||||
CheckWARP(){
|
CheckWARP(){
|
||||||
i=0
|
i=0
|
||||||
while [ $i -le 4 ]; do let i++
|
while [ $i -le 9 ]; do let i++
|
||||||
yellow "共执行5次,第$i次获取warp的IP中……"
|
yellow "共执行10次,第$i次获取warp的IP中……"
|
||||||
kill -15 $(pgrep warp-go) >/dev/null 2>&1 && sleep 2
|
kill -15 $(pgrep warp-go) >/dev/null 2>&1 && sleep 2
|
||||||
systemctl restart warp-go
|
systemctl restart warp-go
|
||||||
systemctl enable warp-go
|
systemctl enable warp-go
|
||||||
|
@ -1146,55 +1179,45 @@ warppflow=$((`grep -oP '"quota":\K\d+' <<< $(curl -sm4 "https://api.cloudflarecl
|
||||||
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
|
||||||
[[ $(curl -s4S https://chat.openai.com/ -I | grep "text/plain") != "" ]] && chat='遗憾,无法访问Chatgpt官网服务' || chat='恭喜,支持访问Chatgpt官网服务'
|
nf4
|
||||||
|
[[ $(curl -s4S https://chat.openai.com/ -I | grep "text/plain") != "" ]] && chat='遗憾,当前IP无法访问Chatgpt官网服务' || chat='恭喜,当前IP支持访问Chatgpt官网服务'
|
||||||
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)
|
||||||
isp4a=`curl -sm6 --user-agent "${UA_Browser}" http://ip-api.com/json/$v4?lang=zh-CN -k | cut -f13 -d ":" | cut -f2 -d '"'`
|
isp4a=`curl -sm6 --user-agent "${UA_Browser}" http://ip-api.com/json/$v4?lang=zh-CN -k | cut -f13 -d ":" | cut -f2 -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"`
|
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=$isp4a || isp4=$isp4b
|
[[ -n $isp4a ]] && isp4=$isp4a || 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 '"')
|
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')
|
||||||
snnf=$(curl -s4m6 ip.p3terx.com -k | sed -n 2p | awk '{print $3}')
|
#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
|
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')" ; white " Chatgpt支持情况:\c" ; rred "$chat");;
|
WARPIPv4Status=$(white "WARP+状态:\c" ; rred "运行中,$cfplus" ; white " 服务商 Cloudflare 获取IPV4地址:\c" ; rred "$v4 $country" ; white " 奈飞NF解锁情况:\c" ; rred "$NF" ; white " ChatGPT解锁情况:\c" ; rred "$chat");;
|
||||||
on)
|
on)
|
||||||
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')" ; white " Chatgpt支持情况:\c" ; green "$chat");;
|
WARPIPv4Status=$(white "WARP状态:\c" ; green "运行中,WARP普通账户(无限WARP流量)" ; white " 服务商 Cloudflare 获取IPV4地址:\c" ; green "$v4 $country" ; white " 奈飞NF解锁情况:\c" ; green "$NF" ; white " ChatGPT解锁情况:\c" ; green "$chat");;
|
||||||
off)
|
off)
|
||||||
WARPIPv4Status=$(white "WARP状态:\c" ; yellow "关闭中" ; white " 服务商 $isp4 获取IPV4地址:\c" ; yellow "$v4 $country" ; white " 奈飞NF解锁情况:\c" ; yellow "$(./nf | awk '{print $1}' | sed -n '3p')" ; white " Chatgpt支持情况:\c" ; yellow "$chat");;
|
WARPIPv4Status=$(white "WARP状态:\c" ; yellow "关闭中" ; white " 服务商 $isp4 获取IPV4地址:\c" ; yellow "$v4 $country" ; white " 奈飞NF解锁情况:\c" ; yellow "$NF" ; white " ChatGPT解锁情况:\c" ; yellow "$chat");;
|
||||||
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
|
||||||
[[ $(curl -s6S https://chat.openai.com/ -I | grep "text/plain") != "" ]] && chat='遗憾,无法访问Chatgpt官网服务' || chat='恭喜,支持访问Chatgpt官网服务'
|
nf6
|
||||||
|
[[ $(curl -s6S https://chat.openai.com/ -I | grep "text/plain") != "" ]] && chat='遗憾,当前IP无法访问Chatgpt官网服务' || chat='恭喜,当前IP支持访问Chatgpt官网服务'
|
||||||
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 -f13 -d":" | cut -f2 -d '"'`
|
isp6a=`curl -sm6 --user-agent "${UA_Browser}" http://ip-api.com/json/$v6?lang=zh-CN -k | cut -f13 -d":" | cut -f2 -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"`
|
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
|
[[ -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}')
|
||||||
if [[ -n $sunf ]]; then
|
|
||||||
country=$sunf
|
|
||||||
elif [[ -z $sunf && -n $nonf ]]; then
|
|
||||||
country=$nonf
|
country=$nonf
|
||||||
else
|
|
||||||
country=$snnf
|
|
||||||
fi
|
|
||||||
case ${wgcfv6} in
|
case ${wgcfv6} in
|
||||||
plus)
|
plus)
|
||||||
WARPIPv6Status=$(white "WARP+状态:\c" ; rred "运行中,$cfplus" ; white " 服务商 Cloudflare 获取IPV6地址:\c" ; rred "$v6 $country" ; white " 奈飞NF解锁情况:\c" ; rred "$(./nf | awk '{print $1}' | sed -n '7p')" ; white " Chatgpt支持情况:\c" ; rred "$chat");;
|
WARPIPv6Status=$(white "WARP+状态:\c" ; rred "运行中,$cfplus" ; white " 服务商 Cloudflare 获取IPV6地址:\c" ; rred "$v6 $country" ; white " 奈飞NF解锁情况:\c" ; rred "$NF" ; white " ChatGPT解锁情况:\c" ; rred "$chat");;
|
||||||
on)
|
on)
|
||||||
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')" ; white " Chatgpt支持情况:\c" ; green "$chat");;
|
WARPIPv6Status=$(white "WARP状态:\c" ; green "运行中,WARP普通账户(无限WARP流量)" ; white " 服务商 Cloudflare 获取IPV6地址:\c" ; green "$v6 $country" ; white " 奈飞NF解锁情况:\c" ; green "$NF" ; white " ChatGPT解锁情况:\c" ; green "$chat");;
|
||||||
off)
|
off)
|
||||||
WARPIPv6Status=$(white "WARP状态:\c" ; yellow "关闭中" ; white " 服务商 $isp6 获取IPV6地址:\c" ; yellow "$v6 $country" ; white " 奈飞NF解锁情况:\c" ; yellow "$(./nf | awk '{print $1}' | sed -n '7p')" ; white " Chatgpt支持情况:\c" ; yellow "$chat");;
|
WARPIPv6Status=$(white "WARP状态:\c" ; yellow "关闭中" ; white " 服务商 $isp6 获取IPV6地址:\c" ; yellow "$v6 $country" ; white " 奈飞NF解锁情况:\c" ; yellow "$NF" ; white " ChatGPT解锁情况:\c" ; yellow "$chat");;
|
||||||
esac
|
esac
|
||||||
else
|
else
|
||||||
WARPIPv6Status=$(white "IPV6状态:\c" ; red "不存在IPV6地址 ")
|
WARPIPv6Status=$(white "IPV6状态:\c" ; red "不存在IPV6地址 ")
|
||||||
|
@ -1377,8 +1400,8 @@ fi
|
||||||
CheckWARP(){
|
CheckWARP(){
|
||||||
i=0
|
i=0
|
||||||
wg-quick down wgcf >/dev/null 2>&1
|
wg-quick down wgcf >/dev/null 2>&1
|
||||||
while [ $i -le 4 ]; do let i++
|
while [ $i -le 9 ]; do let i++
|
||||||
yellow "共执行5次,第$i次获取warp的IP中……"
|
yellow "共执行10次,第$i次获取warp的IP中……"
|
||||||
systemctl restart wg-quick@wgcf >/dev/null 2>&1
|
systemctl restart wg-quick@wgcf >/dev/null 2>&1
|
||||||
checkwgcf
|
checkwgcf
|
||||||
[[ $wgcfv4 =~ on|plus || $wgcfv6 =~ on|plus ]] && green "恭喜!warp的IP获取成功!" && break || red "遗憾!warp的IP获取失败"
|
[[ $wgcfv4 =~ on|plus || $wgcfv6 =~ on|plus ]] && green "恭喜!warp的IP获取成功!" && break || red "遗憾!warp的IP获取失败"
|
||||||
|
|
Loading…
Reference in New Issue