File Coverage

lib/Rex/Service/OpenWrt.pm
Criterion Covered Total %
statement 11 17 64.7
branch n/a
condition 0 3 0.0
subroutine 4 5 80.0
pod 0 1 0.0
total 15 26 57.6


line stmt bran cond sub pod time code
1             #
2             # (c) Jan Gehring
3             #
4              
5             package Rex::Service::OpenWrt;
6              
7 1     1   14 use v5.12.5;
  1         8  
8 1     1   5 use warnings;
  1         3  
  1         40  
9              
10             our $VERSION = '1.14.2.3'; # TRIAL VERSION
11              
12 1     1   12 use Rex::Service::Debian;
  1         2  
  1         8  
13 1     1   33 use base qw(Rex::Service::Debian);
  1         4  
  1         155  
14              
15             sub new {
16 0     0 0   my $that = shift;
17 0   0       my $proto = ref($that) || $that;
18 0           my $self = $proto->SUPER::new(@_);
19              
20 0           bless( $self, $proto );
21              
22             $self->{commands} = {
23 0           start => '/etc/init.d/%s start',
24             restart => '/etc/init.d/%s restart',
25             stop => '/etc/init.d/%s stop',
26             reload => '/etc/init.d/%s reload',
27             status => '/sbin/start-stop-daemon -K -t -q -n %s',
28             ensure_stop => '/etc/init.d/%s disable',
29             ensure_start => '/etc/init.d/%s enable',
30             action => '/etc/init.d/%s %s',
31             };
32              
33 0           return $self;
34             }
35              
36             1;