V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
V2EX 提问指南
qq674949301
V2EX  ›  问与答

关于 ipset 4.5 批量加载 IP 段问题

  •  
  •   qq674949301 · 2015-07-02 12:29:15 +08:00 · 342 次点击
    这是一个创建于 3248 天前的主题,其中的信息可能已经有所发展或是发生改变。
    由于内核版本的限制,不能升级到ipset 到6.x版本,想批量加载IP段,原来写的一个脚本:

    #!/bin/sh
    # Copyright (C) 2015 OpenWrt.org

    _input=/jffs/chnroute.txt
    IPS=/usr/sbin/ipset

    ipset -N gfwlist nethash

    egrep -v "^#|^$" $_input | while IFS= read -r ip

    do
    $IPS -A gfwlist $ip
    done

    循环加载感觉效率太低了,有没有好的办法来批量加载呢?

    使用环境:Tomato shibby
    2 条回复    2015-07-02 18:15:33 +08:00
    LazyZhu
        1
    LazyZhu  
       2015-07-02 13:12:32 +08:00
    qq674949301
        2
    qq674949301  
    OP
       2015-07-02 18:15:33 +08:00 via Android
    @LazyZhu如何写这个脚本!
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   实用小工具   ·   2809 人在线   最高记录 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 25ms · UTC 14:20 · PVG 22:20 · LAX 07:20 · JFK 10:20
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.