From d954e3331ee8a98b311c7b5fb891ca5c0b01968e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BF=83=E9=9A=A8=E7=B7=A3=E5=8B=95?= <88259403+xeefei@users.noreply.github.com> Date: Sun, 3 Aug 2025 23:16:35 +0800 Subject: [PATCH] v2.6.3 v2.6.3 --- main.go | 80 ++++++++++++++++++++++++++++----------------------------- 1 file changed, 40 insertions(+), 40 deletions(-) diff --git a/main.go b/main.go index 3a87b63c..34a050bc 100644 --- a/main.go +++ b/main.go @@ -6,8 +6,8 @@ import ( "log" "os" "os/signal" - "os/exec" - "strings" +// "os/exec" +// "strings" "syscall" _ "unsafe" @@ -131,22 +131,22 @@ func resetSetting() { func showSetting(show bool) { // 执行 shell 命令获取 IPv4 地址 - cmdIPv4 := exec.Command("sh", "-c", "curl -s4m8 ip.p3terx.com -k | sed -n 1p") - outputIPv4, err := cmdIPv4.Output() - if err != nil { - log.Fatal(err) - } + // cmdIPv4 := exec.Command("sh", "-c", "curl -s4m8 ip.p3terx.com -k | sed -n 1p") + // outputIPv4, err := cmdIPv4.Output() + // if err != nil { + // log.Fatal(err) + // } // 执行 shell 命令获取 IPv6 地址 - cmdIPv6 := exec.Command("sh", "-c", "curl -s6m8 ip.p3terx.com -k | sed -n 1p") - outputIPv6, err := cmdIPv6.Output() - if err != nil { - log.Fatal(err) - } + // cmdIPv6 := exec.Command("sh", "-c", "curl -s6m8 ip.p3terx.com -k | sed -n 1p") + // outputIPv6, err := cmdIPv6.Output() + // if err != nil { + // log.Fatal(err) + // } // 去除命令输出中的换行符 - ipv4 := strings.TrimSpace(string(outputIPv4)) - ipv6 := strings.TrimSpace(string(outputIPv6)) +// ipv4 := strings.TrimSpace(string(outputIPv4)) +// ipv6 := strings.TrimSpace(string(outputIPv6)) // 定义转义字符,定义不同颜色的转义字符 const ( Reset = "\033[0m" @@ -212,33 +212,33 @@ func showSetting(show bool) { fmt.Println("") fmt.Println("--------------------------------------------------") // 根据条件打印带颜色的字符串 - if ipv4 != "" { - fmt.Println("") - formattedIPv4 := fmt.Sprintf("%s %s%s:%d%s" + Reset, - Green+"面板 IPv4 访问地址------>>", - Yellow+"http://", - ipv4, - port, - Yellow+webBasePath + Reset) - fmt.Println(formattedIPv4) - fmt.Println("") - } + // if ipv4 != "" { + // fmt.Println("") + // formattedIPv4 := fmt.Sprintf("%s %s%s:%d%s" + Reset, + // Green+"面板 IPv4 访问地址------>>", + // Yellow+"http://", + // ipv4, + // port, + // Yellow+webBasePath + Reset) + // fmt.Println(formattedIPv4) + // fmt.Println("") + // } - if ipv6 != "" { - fmt.Println("") - formattedIPv6 := fmt.Sprintf("%s %s[%s%s%s]:%d%s%s", - Green+"面板 IPv6 访问地址------>>", // 绿色的提示信息 - Yellow+"http://", // 黄色的 http:// 部分 - Yellow, // 黄色的[ 左方括号 - ipv6, // IPv6 地址 - Yellow, // 黄色的] 右方括号 - port, // 端口号 - Yellow+webBasePath, // 黄色的 Web 基础路径 - Reset) // 重置颜色 - fmt.Println(formattedIPv6) - fmt.Println("") - } - fmt.Println(Green + ">>>>>>>>注:若您安装了〔证书〕,请把IP换成您的域名用https方式登录" + Reset) + // if ipv6 != "" { + // fmt.Println("") + // formattedIPv6 := fmt.Sprintf("%s %s[%s%s%s]:%d%s%s", + // Green+"面板 IPv6 访问地址------>>", // 绿色的提示信息 + // Yellow+"http://", // 黄色的 http:// 部分 + // Yellow, // 黄色的[ 左方括号 + // ipv6, // IPv6 地址 + // Yellow, // 黄色的] 右方括号 + // port, // 端口号 + // Yellow+webBasePath, // 黄色的 Web 基础路径 + // Reset) // 重置颜色 + // fmt.Println(formattedIPv6) + // fmt.Println("") + // } + fmt.Println(Green + ">>>>>>>>注:若您安装了〔证书〕,请使用您的域名用https方式登录" + Reset) fmt.Println("") fmt.Println("--------------------------------------------------") fmt.Println("↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑")