From 5aa7f764e92a19df7036b76982bd41d3e454c506 Mon Sep 17 00:00:00 2001 From: fs carmen Date: Tue, 27 May 2025 06:53:31 +0000 Subject: [PATCH] Change IPv4 Api from [ api-ipv4.ip.sb/geoip ] to [ ipinfo.io/ip ]. --- menu.sh | 2 +- warp-go.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/menu.sh b/menu.sh index d274038..fb4d093 100644 --- a/menu.sh +++ b/menu.sh @@ -640,7 +640,7 @@ ip_info() { local IS_UNINSTALL="$3" [ "$L" = 'C' ] && IS_CHINESE=${IS_CHINESE:-'?lang=zh-CN'} - [ "$CHECK_46" = '6' ] && CHOOSE_IP_API='https://api-ipv6.ip.sb/geoip' || CHOOSE_IP_API='https://api-ipv4.ip.sb/geoip' + [ "$CHECK_46" = '6' ] && CHOOSE_IP_API='https://api-ipv6.ip.sb/geoip' || CHOOSE_IP_API='https://ipinfo.io/ip' IP_TRACE=$(curl --retry 2 -ksm5 $INTERFACE_SOCK5 https://www.cloudflare.com/cdn-cgi/trace | awk -F '=' '/^warp=/{print $NF}') if [ -n "$IP_TRACE" ]; then [ "$IS_UNINSTALL" = 'is_uninstall' ] && local API_IP=$(curl -$CHECK_46 --retry 2 -ksm5 --user-agent Mozilla https://api.ip.sb/ip) || local API_IP=$(curl --retry 2 -ksm5 $INTERFACE_SOCK5 --user-agent Mozilla $CHOOSE_IP_API | sed 's/.*"ip":"\([^"]\+\)".*/\1/') diff --git a/warp-go.sh b/warp-go.sh index fab7ea7..2e2c403 100644 --- a/warp-go.sh +++ b/warp-go.sh @@ -564,7 +564,7 @@ ip4_info() { [ "$L" = 'C' ] && IS_CHINESE=${IS_CHINESE:-'?lang=zh-CN'} TRACE4=$(curl --retry 2 -ks4m5 https://www.cloudflare.com/cdn-cgi/trace $INTERFACE_4 | awk -F '=' '/^warp=/{print $NF}') if [ -n "$TRACE4" ]; then - [ "$IS_UNINSTALL" = 'is_uninstall' ] && WAN4=$(curl -4 --retry 2 -ksm5 --user-agent Mozilla https://api.ip.sb/ip) || WAN4=$(curl --retry 2 -ks4m5 -A Mozilla https://api-ipv4.ip.sb/geoip $INTERFACE_4 | sed 's/.*"ip":"\([^"]\+\)".*/\1/') + [ "$IS_UNINSTALL" = 'is_uninstall' ] && WAN4=$(curl -4 --retry 2 -ksm5 --user-agent Mozilla https://api.ip.sb/ip) || WAN4=$(curl --retry 2 -ks4m5 -A Mozilla https://ipinfo.io/ip $INTERFACE_4) [[ -n "$WAN4" && ! "$WAN4" =~ error[[:space:]]+code:[[:space:]]+1015 ]] && IP4_JSON=$(curl --retry 2 -ksm5 --user-agent Mozilla https://ip.forvps.gq/${WAN4}${IS_CHINESE}) || unset WAN4 IP4_JSON=${IP4_JSON:-"$(curl --retry 2 -ks4m3 --user-agent Mozilla https://ifconfig.co/json $INTERFACE_4)"} if [ -n "$IP4_JSON" ]; then