diff options
author | Stig Thormodsrud <stig@io.vyatta.com> | 2009-02-13 14:16:41 -0800 |
---|---|---|
committer | Stig Thormodsrud <stig@io.vyatta.com> | 2009-02-13 14:16:41 -0800 |
commit | de14ea1af63db350e7174f75c9ace4fb13ded6bd (patch) | |
tree | 345fc0bfb1c6d05316bf5ad65f9d2b565ffebeab /scripts | |
parent | 46bd9ea2b372a4668cec4f098af3c606cd3302ac (diff) | |
download | vyatta-cfg-firewall-de14ea1af63db350e7174f75c9ace4fb13ded6bd.tar.gz vyatta-cfg-firewall-de14ea1af63db350e7174f75c9ace4fb13ded6bd.zip |
Add support for "show firewall group".
Diffstat (limited to 'scripts')
-rwxr-xr-x | scripts/firewall/vyatta-ipset.pl | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/scripts/firewall/vyatta-ipset.pl b/scripts/firewall/vyatta-ipset.pl index 3ccd4c3..d1baabb 100755 --- a/scripts/firewall/vyatta-ipset.pl +++ b/scripts/firewall/vyatta-ipset.pl @@ -93,6 +93,20 @@ sub ipset_check_set_type { return; } +sub ipset_show_members { + my ($set_name) = @_; + + die "Error: undefined set_name\n" if ! defined $set_name; + my $group = new Vyatta::IpTables::IpSet($set_name); + return "Group [$set_name] has not been defined\n" if ! $group->exists(); + my $type = $group->get_type(); + my @members = $group->get_members(); + print "Name : $set_name\n"; + print "Type : $type\n"; + print "Members:\n"; + print @members; + return; +} # # main @@ -121,6 +135,8 @@ $rc = ipset_delete_member($set_name, $member) if $action eq 'delete-member'; $rc = ipset_check_set_type($set_name, $set_type) if $action eq 'check-set-type'; +$rc = ipset_show_members($set_name) if $action eq 'show-set-members'; + if (defined $rc) { print $rc; exit 1; |