Code Monkey home page Code Monkey logo

Comments (2)

mkorthof avatar mkorthof commented on June 8, 2024
  1. Why require to use iptables-restore? furthermore I can only find that iptables-save is used to grep rules, when is the rules.v{4/6} created / written to? - For myself I want to disable the restore function as I rely on other scripts to restore rules but want to understand this before I proceed.

Nothing is written to any files.
Restore is optional, to disable set RESTORE=0

  1. When updating does it only add new IP blocks or does it also remove anything that's not in the new downloaded file? - this is not easily clear from the ipset command. - Also wouldn't it be more efficient to replace the rule with the new file rather then checking for each ipblock?

Iirc it only adds. You could ipset flush a set first if you want.
Afaik it cannot use zone files directly, entries need to get added to a set, they are stored as hashes.

from ipset-country.

srulikuk avatar srulikuk commented on June 8, 2024

Restore is optional, to disable set RESTORE=0

Indeed, however in the last IF statement in func_vars (if [ ! -f "$rulesfile" ]; then) it fails if a rules file does not exist.
I will push a fix for this (if RESTORE = 0) you can accept if you want.

Iirc it only adds. You could ipset flush a set first if you want.
Afaik it cannot use zone files directly, entries need to get added to a set, they are stored as hashes.

If it only adds the updates will never remove removed IP's
I will add a param to enable ipset flush

from ipset-country.

Related Issues (12)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.