Skip to content

Commit

Permalink
prefer ipv4, fix 233boy#995 233boy#996
Browse files Browse the repository at this point in the history
  • Loading branch information
233boy committed Nov 10, 2022
1 parent ab15bf6 commit b8ca530
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
3 changes: 2 additions & 1 deletion install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -886,7 +886,8 @@ get_ip() {
# [[ -z $ip ]] && ip=$(curl -s https://api.myip.com | grep -oE "([0-9]{1,3}\.){3}[0-9]{1,3}")
# [[ -z $ip ]] && ip=$(curl -s icanhazip.com)
# [[ -z $ip ]] && ip=$(curl -s myip.ipip.net | grep -oE "([0-9]{1,3}\.){3}[0-9]{1,3}")
export "$(wget -qO- https://dash.cloudflare.com/cdn-cgi/trace | grep ip=)" >/dev/null 2>&1
export "$(wget -4 -qO- https://dash.cloudflare.com/cdn-cgi/trace | grep ip=)" >/dev/null 2>&1
[[ -z $ip ]] && export "$(wget -6 -qO- https://dash.cloudflare.com/cdn-cgi/trace | grep ip=)" >/dev/null 2>&1
[[ -z $ip ]] && echo -e "\n$red 获取IP失败, 这垃圾小鸡扔了吧!$none\n" && exit
}

Expand Down
5 changes: 3 additions & 2 deletions v2ray.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ none='\e[0m'
# Root
[[ $(id -u) != 0 ]] && echo -e " 哎呀……请使用 ${red}root ${none}用户运行 ${yellow}~(^_^) ${none}" && exit 1

_version="v3.66"
_version="v3.67"

cmd="apt-get"

Expand Down Expand Up @@ -2542,7 +2542,8 @@ get_ip() {
# [[ -z $ip ]] && ip=$(curl -s https://api.myip.com | grep -oE "([0-9]{1,3}\.){3}[0-9]{1,3}")
# [[ -z $ip ]] && ip=$(curl -s icanhazip.com)
# [[ -z $ip ]] && ip=$(curl -s myip.ipip.net | grep -oE "([0-9]{1,3}\.){3}[0-9]{1,3}")
export "$(wget -qO- https://dash.cloudflare.com/cdn-cgi/trace | grep ip=)" >/dev/null 2>&1
export "$(wget -4 -qO- https://dash.cloudflare.com/cdn-cgi/trace | grep ip=)" >/dev/null 2>&1
[[ -z $ip ]] && export "$(wget -6 -qO- https://dash.cloudflare.com/cdn-cgi/trace | grep ip=)" >/dev/null 2>&1
[[ -z $ip ]] && echo -e "\n$red 获取IP失败, 这垃圾小鸡扔了吧!$none\n" && exit
}

Expand Down

0 comments on commit b8ca530

Please sign in to comment.