稍微优化
This commit is contained in:
parent
c77429425c
commit
5a7511427f
@ -73,7 +73,7 @@ root@NIUYULING:/mnt/c/Users/root/Desktop/git.aixiao.me/DenyIP-go#
|
|||||||
### 安装
|
### 安装
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
root@NG-FROM:~# wget https://git.aixiao.me/aixiao/DenyIP-go/raw/branch/main/install.sh
|
root@NG-FROM:~# wget -O install.sh https://git.aixiao.me/aixiao/DenyIP-go/raw/branch/main/install.sh
|
||||||
--2025-01-15 10:56:09-- https://git.aixiao.me/aixiao/DenyIP-go/raw/branch/main/install.sh
|
--2025-01-15 10:56:09-- https://git.aixiao.me/aixiao/DenyIP-go/raw/branch/main/install.sh
|
||||||
Resolving git.aixiao.me (git.aixiao.me)... 47.240.75.93
|
Resolving git.aixiao.me (git.aixiao.me)... 47.240.75.93
|
||||||
Connecting to git.aixiao.me (git.aixiao.me)|47.240.75.93|:443... connected.
|
Connecting to git.aixiao.me (git.aixiao.me)|47.240.75.93|:443... connected.
|
||||||
|
5
main.go
5
main.go
@ -18,7 +18,7 @@ import (
|
|||||||
|
|
||||||
var (
|
var (
|
||||||
daemon = flag.Bool("d", false, "守护进程模式")
|
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)
|
log.Printf("获取Ip地域出错: %v", err)
|
||||||
} else {
|
} else {
|
||||||
log.Printf("\033[31m%s %s\033[0m\n", e1.Value.(net.IP).String(), position) // 打印地域
|
log.Printf("\033[31m%s %s\033[0m\n", e1.Value.(net.IP).String(), position) // 打印地域
|
||||||
|
|
||||||
if !strings.Contains(position, "中国") && !strings.Contains(position, "内网") {
|
if !strings.Contains(position, "中国") && !strings.Contains(position, "内网") {
|
||||||
AddIPSet(IPSET_NAME, e1.Value.(net.IP).String()) // 添加 Ip 到 ipset 集合
|
AddIPSet(IPSET_NAME, e1.Value.(net.IP).String()) // 添加 Ip 到 ipset 集合
|
||||||
IpList.Remove(e1) // 移除第一个元素
|
IpList.Remove(e1) // 移除第一个元素
|
||||||
|
} else { // 这时是国内地址
|
||||||
|
IpList.Remove(e1) // 移除第一个元素
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else { // 这时是国内地址
|
} else { // 这时是国内地址
|
||||||
|
Loading…
x
Reference in New Issue
Block a user