Compare commits

...

1 Commits
main ... dev

Author SHA1 Message Date
90e5fe0054 add ping via sudo command 2022-03-17 06:40:16 +01:00

View File

@ -1,4 +1,4 @@
# $Id: 73_PRESENCE.pm 20782 2019-12-19 10:51:06Z markusbloch $
# $Id: 73_PRESENCE.pm 20782 2019-12-19 10:51:06Z markusbloch $
##############################################################################
#
# 73_PRESENCE.pm
@ -51,6 +51,7 @@ PRESENCE_Initialize($)
"disabledForIntervals ".
"fritzboxCheckSpeed:0,1 ".
"pingCount:1,2,3,4,5,6,7,8,9,10 ".
"pingPerSUDO:0,1 ".
"bluetoothHciDevice ".
"absenceThreshold ".
"presenceThreshold ".
@ -778,6 +779,7 @@ sub PRESENCE_DoLocalPingScan($)
my $retcode;
my $return;
my $temp;
my $pingCmd = (AttrVal($name,'pingPerSUDO',0) == 1 ? 'sudo ping' : 'ping');
$SIG{CHLD} = 'IGNORE';
@ -814,7 +816,7 @@ sub PRESENCE_DoLocalPingScan($)
}
else
{
$temp = qx(ping -c $count $device 2>&1);
$temp = qx($pingCmd -c $count $device 2>&1);
if(defined($temp) and $temp ne "")
{
@ -2119,3 +2121,4 @@ Options:
=end html_DE
=cut