mirror of
https://github.com/centreon/centreon-plugins.git
synced 2025-04-07 20:35:27 +02:00
enh(protocol/snmp): collection mode - config option with carriage return (#2996)
This commit is contained in:
parent
4cb1c48c0d
commit
eb1c4cf5ea
@ -153,7 +153,9 @@ sub read_config {
|
||||
my ($self, %options) = @_;
|
||||
|
||||
my $content;
|
||||
if (-f $self->{option_results}->{config}) {
|
||||
if ($self->{option_results}->{config} =~ /\n/m || ! -f "$self->{option_results}->{config}") {
|
||||
$content = $self->{option_results}->{config};
|
||||
} else {
|
||||
$content = do {
|
||||
local $/ = undef;
|
||||
if (!open my $fh, '<', $self->{option_results}->{config}) {
|
||||
@ -162,8 +164,6 @@ sub read_config {
|
||||
}
|
||||
<$fh>;
|
||||
};
|
||||
} else {
|
||||
$content = $self->{option_results}->{config};
|
||||
}
|
||||
|
||||
eval {
|
||||
|
Loading…
x
Reference in New Issue
Block a user