mirror of
https://github.com/vincentmli/bpfire.git
synced 2026-04-09 18:45:54 +02:00
rules.pl: Add tiny ipset_restore function.
This helper function is used to load a previously exported list of networks for a given country code into the ipset module, so it can be used for any kind of firewall rules. Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org> Reviewed-by: Peter Müller <peter.mueller@ipfire.org> Reviewed-by: Michael Tremer <michael.tremer@ipfire.org>
This commit is contained in:
committed by
Peter Müller
parent
3d88688075
commit
6babb404cc
@@ -888,3 +888,10 @@ sub firewall_is_in_subnet {
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
sub ipset_restore ($) {
|
||||
my ($ccode) = @_;
|
||||
|
||||
# Run ipset and restore the list of the given country code.
|
||||
run("$IPSET restore < $Location::Functions::ipset_db_directory/$ccode.ipset4");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user