line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package # hidden from cpan |
2
|
|
|
|
|
|
|
Monitoring::Generator::TestConfig::ShinkenInitScriptData; |
3
|
|
|
|
|
|
|
|
4
|
3
|
|
|
3
|
|
9
|
use strict; |
|
3
|
|
|
|
|
3
|
|
|
3
|
|
|
|
|
72
|
|
5
|
3
|
|
|
3
|
|
8
|
use warnings; |
|
3
|
|
|
|
|
4
|
|
|
3
|
|
|
|
|
426
|
|
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
######################################## |
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
=over 4 |
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
=item get_init_script |
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
returns the init script source |
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
adapted from the nagios debian package |
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
=back |
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
=cut |
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
sub get_init_script { |
22
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
23
|
0
|
|
|
|
|
|
my $prefix = shift; |
24
|
0
|
|
|
|
|
|
my $binary = shift; |
25
|
0
|
|
|
|
|
|
our $initsource; |
26
|
0
|
0
|
|
|
|
|
if(!defined $initsource) { |
27
|
0
|
|
|
|
|
|
while(my $line = ) { $initsource .= $line; } |
|
0
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
} |
29
|
|
|
|
|
|
|
|
30
|
0
|
|
|
|
|
|
my $binpath = $binary; |
31
|
0
|
|
|
|
|
|
$binpath =~ s/^(.*)\/.*$/$1/mx; |
32
|
|
|
|
|
|
|
|
33
|
0
|
|
|
|
|
|
my $initscript = $initsource; |
34
|
0
|
|
|
|
|
|
$initscript =~ s/__PREFIX__/$prefix/gmx; |
35
|
0
|
|
|
|
|
|
$initscript =~ s/__BIN__/$binpath/gmx; |
36
|
0
|
|
|
|
|
|
return($initscript); |
37
|
|
|
|
|
|
|
} |
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
1; |
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
__DATA__ |