Commit | Line | Data |
afd7c030 |
1 | package System::Introspector::Probe::ResolvConf; |
9cebf8c1 |
2 | use Moo; |
3 | |
f3d816a0 |
4 | use System::Introspector::Util qw( |
13642dda |
5 | output_from_file |
f3d816a0 |
6 | transform_exceptions |
7 | ); |
8 | |
21fd4f46 |
9 | has resolv_conf_file => ( |
10 | is => 'ro', |
11 | default => sub { '/etc/resolv.conf' }, |
12 | ); |
13 | |
9cebf8c1 |
14 | sub gather { |
15 | my ($self) = @_; |
13642dda |
16 | return { |
17 | resolv_conf_file => transform_exceptions { |
18 | my $file = $self->resolv_conf_file; |
19 | return { |
20 | file_name => $file, |
21 | body => scalar output_from_file $file, |
22 | }; |
23 | }, |
f3d816a0 |
24 | }; |
9cebf8c1 |
25 | } |
26 | |
9cebf8c1 |
27 | 1; |
535e84b6 |
28 | |
29 | __END__ |
30 | |
31 | =head1 NAME |
32 | |
33 | System::Introspector::ResolvConf - Gather name resolution configuration |
34 | |
35 | =head1 DESCRIPTION |
36 | |
37 | Reads a C<resolv.conf> file to gather information about name resolution. |
38 | |
39 | =head1 ATTRIBUTES |
40 | |
41 | =head2 resolv_conf_file |
42 | |
43 | The path to the C<resolv.conf> file that should be read. Defaults to |
44 | C</etc/resolv.conf>. |
45 | |
46 | =head1 SEE ALSO |
47 | |
48 | =over |
49 | |
50 | =item L<System::Introspector> |
51 | |
52 | =back |
53 | |
54 | =cut |
55 | |