修复错误

This commit is contained in:
aixiao 2025-01-15 15:42:38 +08:00
parent f8d1abb527
commit c77429425c
3 changed files with 10 additions and 3 deletions

BIN
denyip

Binary file not shown.

View File

@ -9,6 +9,12 @@ init()
main()
{
if test "$1" = "rm"; then
killall -15 denyip
rm -rf $DENYIP_HOME
exit 0
fi
if ! test -d $DENYIP_HOME; then
mkdir -p $DENYIP_HOME
mkdir -p $DENYIP_HOME/ip2region

View File

@ -182,10 +182,11 @@ func runMainProcess() { // 主进程逻辑
} 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)
}