mirror of
https://github.com/zu1k/nali.git
synced 2025-02-13 15:52:41 +08:00
add ipv6 support
This commit is contained in:
parent
e453848e18
commit
ae7eed8de6
@ -19,10 +19,12 @@
|
|||||||
## Feature
|
## Feature
|
||||||
|
|
||||||
- Chunzhen qqip database
|
- Chunzhen qqip database
|
||||||
|
- ZX ipv6 database
|
||||||
- Geoip2 city database
|
- Geoip2 city database
|
||||||
- Pipeline support
|
- Pipeline support
|
||||||
- Interactive query
|
- Interactive query
|
||||||
- Offline query
|
- Offline query
|
||||||
|
- Both ipv4 and ipv6 support
|
||||||
|
|
||||||
## Install
|
## Install
|
||||||
|
|
||||||
@ -177,6 +179,7 @@ export NALI_DB=geoip
|
|||||||
- [纯真QQIP离线数据库](http://www.cz88.net/fox/ipdat.shtml)
|
- [纯真QQIP离线数据库](http://www.cz88.net/fox/ipdat.shtml)
|
||||||
- [qqwry mirror](https://qqwry.mirror.noc.one/)
|
- [qqwry mirror](https://qqwry.mirror.noc.one/)
|
||||||
- [qqwry纯真数据库解析](https://github.com/yinheli/qqwry)
|
- [qqwry纯真数据库解析](https://github.com/yinheli/qqwry)
|
||||||
|
- [ZX公网ipv6数据库](https://ip.zxinc.org/ipquery/)
|
||||||
- [Geoip2 city数据库](https://www.maxmind.com/en/geoip2-precision-city-service)
|
- [Geoip2 city数据库](https://www.maxmind.com/en/geoip2-precision-city-service)
|
||||||
- [geoip2-golang解析器](https://github.com/oschwald/geoip2-golang)
|
- [geoip2-golang解析器](https://github.com/oschwald/geoip2-golang)
|
||||||
- [Cobra CLI库](https://github.com/spf13/cobra)
|
- [Cobra CLI库](https://github.com/spf13/cobra)
|
||||||
|
@ -23,15 +23,8 @@ func NewZXwry(filePath string) ZXwry {
|
|||||||
// 判断文件是否存在
|
// 判断文件是否存在
|
||||||
_, err := os.Stat(filePath)
|
_, err := os.Stat(filePath)
|
||||||
if err != nil && os.IsNotExist(err) {
|
if err != nil && os.IsNotExist(err) {
|
||||||
log.Println("文件不存在,尝试从网络获取最新ZX IPv6 库")
|
log.Println("文件不存在,请自行下载 ZX IPV6库,并保存在", filePath)
|
||||||
tmpData, err = GetOnline()
|
os.Exit(1)
|
||||||
if err != nil {
|
|
||||||
panic(err)
|
|
||||||
} else {
|
|
||||||
if err := ioutil.WriteFile(filePath, tmpData, 0644); err == nil {
|
|
||||||
log.Printf("已将最新的ZX IPv6 库保存到本地 %s ", filePath)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
// 打开文件句柄
|
// 打开文件句柄
|
||||||
fileInfo.FileBase, err = os.OpenFile(filePath, os.O_RDONLY, 0400)
|
fileInfo.FileBase, err = os.OpenFile(filePath, os.O_RDONLY, 0400)
|
||||||
|
Loading…
Reference in New Issue
Block a user