summaryrefslogtreecommitdiff
path: root/scripts/firewall/vyatta-ipset.pl
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/firewall/vyatta-ipset.pl')
-rwxr-xr-xscripts/firewall/vyatta-ipset.pl9
1 files changed, 9 insertions, 0 deletions
diff --git a/scripts/firewall/vyatta-ipset.pl b/scripts/firewall/vyatta-ipset.pl
index ef964f3..99ae085 100755
--- a/scripts/firewall/vyatta-ipset.pl
+++ b/scripts/firewall/vyatta-ipset.pl
@@ -36,6 +36,13 @@ use Sort::Versions;
use warnings;
use strict;
+sub ipset_reset {
+ my ($set_name, $set_type) = @_;
+
+ my $group = new Vyatta::IpTables::IpSet($set_name, $set_type);
+
+ return $group->reset_ipset();
+}
sub ipset_create {
my ($set_name, $set_type) = @_;
@@ -310,6 +317,8 @@ GetOptions("action=s" => \$action,
die "undefined action" if ! defined $action;
my $rc;
+$rc = ipset_reset($set_name, $set_type) if $action eq 'reset-set';
+
$rc = ipset_create($set_name, $set_type) if $action eq 'create-set';
$rc = ipset_delete($set_name) if $action eq 'delete-set';