summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorGaurav Sinha <gaurav.sinha@vyatta.com>2012-11-19 12:31:29 -0800
committerGaurav Sinha <gaurav.sinha@vyatta.com>2012-11-19 12:31:29 -0800
commit51a7cc7cb639adc2cdf8c3a4028a20f75d8d5eeb (patch)
tree9ebb6f317f858511a5f81965bc83aba9e4bcf6e2 /scripts
parent8b73ec3cd927f95d0a6ac2b02a1f718e0d1ea349 (diff)
downloadvyatta-cfg-firewall-51a7cc7cb639adc2cdf8c3a4028a20f75d8d5eeb.tar.gz
vyatta-cfg-firewall-51a7cc7cb639adc2cdf8c3a4028a20f75d8d5eeb.zip
initial script for reset firewall group command
(cherry picked from commit c10ab7f443c581ffd31779f6e32b0d28f5c8366f) (cherry picked from commit 2029744d3b7cc83b7568e3fa474c8d079efece38) Conflicts: scripts/firewall/vyatta-ipset.pl
Diffstat (limited to 'scripts')
-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';