稍微优化
This commit is contained in:
5
main.go
5
main.go
@@ -18,7 +18,7 @@ import (
|
||||
|
||||
var (
|
||||
daemon = flag.Bool("d", false, "守护进程模式")
|
||||
child = flag.Bool("child", false, "子进程模式")
|
||||
child = flag.Bool("child", false, "子进程模式, (不要使用!!!)")
|
||||
)
|
||||
|
||||
// 全局变量
|
||||
@@ -181,10 +181,11 @@ func runMainProcess() { // 主进程逻辑
|
||||
log.Printf("获取Ip地域出错: %v", err)
|
||||
} else {
|
||||
log.Printf("\033[31m%s %s\033[0m\n", e1.Value.(net.IP).String(), position) // 打印地域
|
||||
|
||||
if !strings.Contains(position, "中国") && !strings.Contains(position, "内网") {
|
||||
AddIPSet(IPSET_NAME, e1.Value.(net.IP).String()) // 添加 Ip 到 ipset 集合
|
||||
IpList.Remove(e1) // 移除第一个元素
|
||||
} else { // 这时是国内地址
|
||||
IpList.Remove(e1) // 移除第一个元素
|
||||
}
|
||||
}
|
||||
} else { // 这时是国内地址
|
||||
|
||||
Reference in New Issue
Block a user