Comments (13)
你这个有语法错误,可以优化下,一个awk就够啦
#!/bin/bash
curl -O https://ispip.clang.cn/all_cn_cidr.txt
awk 'BEGIN{ FS="/"; OFS="" } {
mask = "";
if ($2 == "10") mask = "255.192.0.0";
else if ($2 == "11") mask = "255.224.0.0";
else if ($2 == "12") mask = "255.240.0.0";
else if ($2 == "13") mask = "255.248.0.0";
else if ($2 == "14") mask = "255.252.0.0";
else if ($2 == "15") mask = "255.254.0.0";
else if ($2 == "16") mask = "255.255.0.0";
else if ($2 == "17") mask = "255.255.128.0";
else if ($2 == "18") mask = "255.255.192.0";
else if ($2 == "19") mask = "255.255.224.0";
else if ($2 == "20") mask = "255.255.240.0";
else if ($2 == "21") mask = "255.255.248.0";
else if ($2 == "22") mask = "255.255.252.0";
else if ($2 == "23") mask = "255.255.254.0";
else if ($2 == "24") mask = "255.255.255.0";
print "{\"val\":\""$1"/"$2"\",\"ip_mask\":\""$1"/"mask"\",\"note\":\"\"},"
}' all_cn_cidr.txt > new_all_cn_cidr.txt
grep '255.255.255.255' -n new_all_cn_cidr.txt
from anylink.
你这个有语法错误,可以优化下,一个awk就够啦
#!/bin/bash curl -O https://ispip.clang.cn/all_cn_cidr.txt awk 'BEGIN{ FS="/"; OFS="" } { mask = ""; if ($2 == "10") mask = "255.192.0.0"; else if ($2 == "11") mask = "255.224.0.0"; else if ($2 == "12") mask = "255.240.0.0"; else if ($2 == "13") mask = "255.248.0.0"; else if ($2 == "14") mask = "255.252.0.0"; else if ($2 == "15") mask = "255.254.0.0"; else if ($2 == "16") mask = "255.255.0.0"; else if ($2 == "17") mask = "255.255.128.0"; else if ($2 == "18") mask = "255.255.192.0"; else if ($2 == "19") mask = "255.255.224.0"; else if ($2 == "20") mask = "255.255.240.0"; else if ($2 == "21") mask = "255.255.248.0"; else if ($2 == "22") mask = "255.255.252.0"; else if ($2 == "23") mask = "255.255.254.0"; else if ($2 == "24") mask = "255.255.255.0"; print "{\"val\":\""$1"/"$2"\",\"ip_mask\":\""$1"/"mask"\",\"note\":\"\"}," }' all_cn_cidr.txt > new_all_cn_cidr.txt grep '255.255.255.255' -n new_all_cn_cidr.txt
from anylink.
我也想排除大陆的所有IP地址,但是里面只能一条一条加??? 要怎么导入?? 放在db里面??
from anylink.
目前Anyconnect桌面端的上限是2500条,移动端约200条。
from anylink.
我也想排除大陆的所有IP地址,但是里面只能一条一条加??? 要怎么导入?? 放在db里面??
#278 新增加了 编辑模式,可以批量导入。
from anylink.
我也想排除大陆的所有IP地址,但是里面只能一条一条加??? 要怎么导入?? 放在db里面??
#278 新增加了 编辑模式,可以批量导入。
谢谢,我用docker部署了,要怎么更新这个文件? 找半天没找到。
from anylink.
我也想排除大陆的所有IP地址,但是里面只能一条一条加??? 要怎么导入?? 放在db里面??
#!/bin/bash
curl -O https://ispip.clang.cn/all_cn_cidr.txt
awk '{print $1,$1}' all_cn_cidr.txt > new.txt
sed -i 's/^/{"val":"/g' new.txt
awk 'BEGIN{ FS=" ";OFS="," }{ print $1,$2 }' new.txt > new1.txt
sed -i 's/,/","ip_mask":"/g' new1.txt
awk -F '/' '{OFS="/"} {sub(/10$/, "255.192.0.0", $3); print}' new1.txt > new2.txt
awk -F '/' '{OFS="/"} {sub(/11$/, "255.224.0.0", $3); print}' new2.txt > new1.txt
awk -F '/' '{OFS="/"} {sub(/12$/, "255.240.0.0", $3); print}' new1.txt > new2.txt
awk -F '/' '{OFS="/"} {sub(/13$/, "255.248.0.0", $3); print}' new2.txt > new1.txt
awk -F '/' '{OFS="/"} {sub(/14$/, "255.252.0.0", $3); print}' new1.txt > new2.txt
awk -F '/' '{OFS="/"} {sub(/15$/, "255.254.0.0", $3); print}' new2.txt > new1.txt
awk -F '/' '{OFS="/"} {sub(/16$/, "255.255.0.0", $3); print}' new1.txt > new2.txt
awk -F '/' '{OFS="/"} {sub(/17$/, "255.255.128.0", $3); print}' new2.txt > new1.txt
awk -F '/' '{OFS="/"} {sub(/18$/, "255.255.192.0", $3); print}' new1.txt > new2.txt
awk -F '/' '{OFS="/"} {sub(/19$/, "255.255.224.0", $3); print}' new2.txt > new1.txt
awk -F '/' '{OFS="/"} {sub(/20$/, "255.255.240.0", $3); print}' new1.txt > new2.txt
awk -F '/' '{OFS="/"} {sub(/21$/, "255.255.248.0", $3); print}' new2.txt > new1.txt
awk -F '/' '{OFS="/"} {sub(/22$/, "255.255.252.0", $3); print}' new1.txt > new2.txt
awk -F '/' '{OFS="/"} {sub(/23$/, "255.255.254.0", $3); print}' new2.txt > new1.txt
awk -F '/' '{OFS="/"} {sub(/24$/, "255.255.255.0", $3); print}' new1.txt > all_cn_cidr.txt
sed -i 's/$/","note":""},/g' all_cn_cidr.txt
grep '255.255.255.255' -rn all_cn_cidr.txt
这个就是清洗出大陆的路由脚本,然后你再把这些数据直接添加到anylink.db相应表字段中。就可以
from anylink.
里面有5000多条,但是这个程序只能2000条。而且加起来麻烦啊。。。。
#278 新增加了 编辑模式,可以批量导入。不知道怎么更新这个文件?找不到这个文件。
from anylink.
里面有5000多条,但是这个程序只能2000条。而且加起来麻烦啊。。。。
#278 新增加了 编辑模式,可以批量导入。不知道怎么更新这个文件?找不到这个文件。
anyconnect的windows客户端只支持2000多条,但是他自家的anylink客户端支持5000多
https://anylink.pro
from anylink.
这么多..... 那我取消一下限制2000条的数量。
from anylink.
我也想排除大陆的所有IP地址,但是里面只能一条一条加??? 要怎么导入?? 放在db里面??
#278 新增加了 编辑模式,可以批量导入。
谢谢,我用docker部署了,要怎么更新这个文件? 找半天没找到。
你好,需要作者合并代码,再等几天。
from anylink.
作者已经合并到dev。
from anylink.
作者已经合并到dev。
我更新docker就行吗?
from anylink.
Related Issues (20)
- 0.11.1版本会意外断开连接 HOT 4
- 建议在权限控制模块添加连续端口或多个端口选项
- 建议修改认证方式为单独使用OTP选项或者单独使用PIN选项或者二者结合使用
- 希望可以在用户组的“权限控制“页面中添加和“路由设置”一样的编辑模式
- link_tun.go:20: [Fatal] open tun err: no such device HOT 2
- affected/package: 无法编译出主程序二进制文件 HOT 1
- Gmail QR Code無正常顯示 HOT 3
- 客户端连接报tunnel negotiation failed 401 Unauthorized HOT 6
- [docker] 创建镜像并配置好证书,用户, 客户端可以远程连接,但无法访问内网 HOT 1
- affected/package: 安全性方面增加频率控制
- affected/package: 0.12.1 使用建议
- 在线用户能否增加姓名显示 HOT 2
- 是否可以增对配置的导入导出功能,方便备份
- 希望增加用户流量统计功能
- 希望增加自定义接口名称的前缀的功能
- anylink支持能否增加支持【accept-challenge】消息,先输入密码,验证成功后再次输入TOTP验证码
- 希望可以增加企业微信的机器人发送通知.
- 功能性改进-添加防爆破功能增强安全性 HOT 1
- 不使用docker,编译server报错main.go:19:12: pattern ui: no matching files found HOT 1
- docke 容器部署,vpn能连接上,但是只能访问到docker容器的ip地址,其他地址无法访问到 HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from anylink.