File Coverage

blib/lib/Metabrik/System/Freebsd/Pf.pm
Criterion Covered Total %
statement 9 16 56.2
branch n/a
condition n/a
subroutine 3 6 50.0
pod 1 3 33.3
total 13 25 52.0


line stmt bran cond sub pod time code
1             #
2             # $Id$
3             #
4             # system::freebsd::pf Brik
5             #
6             package Metabrik::System::Freebsd::Pf;
7 1     1   861 use strict;
  1         3  
  1         29  
8 1     1   5 use warnings;
  1         2  
  1         27  
9              
10 1     1   6 use base qw(Metabrik::Shell::Command);
  1         2  
  1         238  
11              
12             sub brik_properties {
13             return {
14 0     0 1   revision => '$Revision$',
15             tags => [ qw(unstable packet filter fw firewall) ],
16             author => 'GomoR ',
17             license => 'http://opensource.org/licenses/BSD-3-Clause',
18             commands => {
19             edit => [ ],
20             reload => [ ],
21             console => [ qw(jail_name) ],
22             },
23             require_binaries => {
24             'pfctl' => [ ],
25             },
26             };
27             }
28              
29             sub edit {
30 0     0 0   my $self = shift;
31              
32 0           my $cmd = "sudo vi /etc/pf.conf";
33              
34 0           return $self->execute($cmd);
35             }
36              
37             sub reload {
38 0     0 0   my $self = shift;
39              
40 0           my $cmd = "sudo pfctl -f /etc/pf.conf";
41              
42 0           return $self->system($cmd);
43             }
44              
45             1;
46              
47             __END__