mirror of
https://github.com/fhem/fhem-mirror.git
synced 2025-03-10 09:16:53 +00:00
PRESENCE: recognize execution failure of ping-check
git-svn-id: https://svn.fhem.de/fhem/trunk@3736 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
parent
2047a2c3fd
commit
f20006dd7a
@ -535,9 +535,17 @@ PRESENCE_DoLocalPingScan($)
|
|||||||
{
|
{
|
||||||
$temp = qx(ping -c $count $device);
|
$temp = qx(ping -c $count $device);
|
||||||
|
|
||||||
|
chomp $temp;
|
||||||
|
if($temp ne "")
|
||||||
|
{
|
||||||
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 = "$name|$local|".($temp =~ /\d+ [Bb]ytes (from|von)/ ? "present" : "absent");
|
$return = "$name|$local|".($temp =~ /\d+ [Bb]ytes (from|von)/ ? "present" : "absent");
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$return = "$name|$local|error|Could not execute ping command: \"ping -c $count $device\"";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return $return;
|
return $return;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user