V2EX = way to explore
V2EX 是一个关于分享和探索的地方
Sign Up Now
For Existing Member  Sign In
qq674949301
V2EX  ›  问与答

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

  •  
  •   qq674949301 · Jul 2, 2015 · 1045 views
    This topic created in 3959 days ago, the information mentioned may be changed or developed.
    由于内核版本的限制,不能升级到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 replies    2015-07-02 18:15:33 +08:00
    qq674949301
        2
    qq674949301  
    OP
       Jul 2, 2015 via Android
    @LazyZhu如何写这个脚本!
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   1078 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 31ms · UTC 23:58 · PVG 07:58 · LAX 16:58 · JFK 19:58
    ♥ Do have faith in what you're doing.