feat(脚本): 优化IPv6检测
parent
c78f1dc2d6
commit
cc2718d512
|
@ -4777,10 +4777,9 @@ aliasInstall() {
|
||||||
|
|
||||||
# 检查ipv6、ipv4
|
# 检查ipv6、ipv4
|
||||||
checkIPv6() {
|
checkIPv6() {
|
||||||
# pingIPv6=$(ping6 -c 1 www.google.com | sed '2{s/[^(]*(//;s/).*//;q;}' | tail -n +2)
|
currentIPv6IP=$(curl -s -6 http://www.cloudflare.com/cdn-cgi/trace | grep "ip" | cut -d "=" -f 2)
|
||||||
pingIPv6=$(ping6 -c 1 www.google.com | sed -n '1p' | sed 's/.*(//g;s/).*//g')
|
|
||||||
|
|
||||||
if [[ -z "${pingIPv6}" ]]; then
|
if [[ -z "${currentIPv6IP}" ]]; then
|
||||||
echoContent red " ---> 不支持ipv6"
|
echoContent red " ---> 不支持ipv6"
|
||||||
exit 0
|
exit 0
|
||||||
fi
|
fi
|
||||||
|
|
Loading…
Reference in New Issue