稍微优化

This commit is contained in:
aixiao 2025-01-15 17:41:58 +08:00
parent c77429425c
commit 5a7511427f
3 changed files with 4 additions and 3 deletions

View File

@ -73,7 +73,7 @@ root@NIUYULING:/mnt/c/Users/root/Desktop/git.aixiao.me/DenyIP-go#
### 安装
```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
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.

BIN
denyip

Binary file not shown.

View File

@ -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 { // 这时是国内地址