Merge pull request #120 from xeefei/3x-ui
more list for public IP address
This commit is contained in:
commit
46b73e03a2
@ -7,7 +7,6 @@ yellow='\033[0;33m'
|
|||||||
plain='\033[0m'
|
plain='\033[0m'
|
||||||
|
|
||||||
cur_dir=$(pwd)
|
cur_dir=$(pwd)
|
||||||
show_ip_service_lists=("https://api.ipify.org" "https://4.ident.me")
|
|
||||||
|
|
||||||
# check root
|
# check root
|
||||||
[[ $EUID -ne 0 ]] && echo -e "${red}致命错误: ${plain} 请使用 root 权限运行此脚本\n" && exit 1
|
[[ $EUID -ne 0 ]] && echo -e "${red}致命错误: ${plain} 请使用 root 权限运行此脚本\n" && exit 1
|
||||||
|
|||||||
@ -235,8 +235,21 @@ func (s *ServerService) GetStatus(lastStatus *Status) *Status {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// IP fetching with caching
|
// IP fetching with caching
|
||||||
showIp4ServiceLists := []string{"https://api.ipify.org", "https://4.ident.me"}
|
showIp4ServiceLists := []string{
|
||||||
showIp6ServiceLists := []string{"https://api6.ipify.org", "https://6.ident.me"}
|
"https://api4.ipify.org",
|
||||||
|
"https://ipv4.icanhazip.com",
|
||||||
|
"https://v4.api.ipinfo.io/ip",
|
||||||
|
"https://ipv4.myexternalip.com/raw",
|
||||||
|
"https://4.ident.me",
|
||||||
|
"https://check-host.net/ip",
|
||||||
|
}
|
||||||
|
showIp6ServiceLists := []string{
|
||||||
|
"https://api6.ipify.org",
|
||||||
|
"https://ipv6.icanhazip.com",
|
||||||
|
"https://v6.api.ipinfo.io/ip",
|
||||||
|
"https://ipv6.myexternalip.com/raw",
|
||||||
|
"https://6.ident.me",
|
||||||
|
}
|
||||||
|
|
||||||
if s.cachedIPv4 == "" {
|
if s.cachedIPv4 == "" {
|
||||||
for _, ip4Service := range showIp4ServiceLists {
|
for _, ip4Service := range showIp4ServiceLists {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user