fix error by initial

This commit is contained in:
Marko Oldenburg 2017-04-18 12:41:14 +02:00
parent c042831b66
commit 1746ecb6a0

View File

@ -1339,21 +1339,21 @@ sub LGTV_WebOS_Presence($) {
my $hash = shift; my $hash = shift;
my $name = $hash-{NAME}; my $name = $hash->{NAME};
my $temp; my $temp;
$temp = qx(ping -c 1 -w 1 $hash->{$HOST} 2>&1); $temp = qx(ping -c 1 -w 1 $hash->{HOST} 2>&1);
if(defined($temp) and $temp ne "") { if(defined($temp) and $temp ne "") {
chomp $temp; chomp $temp;
Log3 $name, 5, "PRESENCE ($name) - ping command returned with output:\n$temp"; Log3 $name, 5, "PRESENCE ($name) - ping command returned with output:\n$temp";
$return (($temp =~ /\d+ [Bb]ytes (from|von)/ and not $temp =~ /[Uu]nreachable/) ? "present" : "absent"); return (($temp =~ /\d+ [Bb]ytes (from|von)/ and not $temp =~ /[Uu]nreachable/) ? "present" : "absent");
} else { } else {
$return 'Could not execute ping command'; return 'Could not execute ping command';
} }
} }