mirror of
https://github.com/fhem/fhem-mirror.git
synced 2025-05-04 22:19:38 +00:00
PRESENCE: use "w" parameter when busybox ps is used in mode local-bluetooth
git-svn-id: https://svn.fhem.de/fhem/trunk/fhem@4319 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
parent
97585e0197
commit
fd32832668
@ -667,6 +667,19 @@ PRESENCE_DoLocalBluetoothScan($)
|
|||||||
my $wait = 1;
|
my $wait = 1;
|
||||||
my $ps;
|
my $ps;
|
||||||
|
|
||||||
|
my $psargs = "ax";
|
||||||
|
|
||||||
|
if(qx(ps --help 2>&1) =~ /BusyBox/g)
|
||||||
|
{
|
||||||
|
Log3 $name, 5, "PRESENCE ($name): found busybox variant of ps command, using \"w\" as parameter";
|
||||||
|
$psargs = "w";
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Log3 $name, 5, "PRESENCE ($name): found standard variant of ps command, using \"ax\" as parameter";
|
||||||
|
$psargs = "ax";
|
||||||
|
}
|
||||||
|
|
||||||
Log3 $name, 4, "PRESENCE ($name): 'which hcitool' returns: $hcitool";
|
Log3 $name, 4, "PRESENCE ($name): 'which hcitool' returns: $hcitool";
|
||||||
chomp $hcitool;
|
chomp $hcitool;
|
||||||
|
|
||||||
@ -675,7 +688,7 @@ PRESENCE_DoLocalBluetoothScan($)
|
|||||||
{
|
{
|
||||||
while($wait)
|
while($wait)
|
||||||
{ # check if another hcitool process is running
|
{ # check if another hcitool process is running
|
||||||
$ps = qx(ps ax | grep hcitool | grep -v grep);
|
$ps = qx(ps $psargs | grep hcitool | grep -v grep);
|
||||||
if(not $ps =~ /^\s*$/)
|
if(not $ps =~ /^\s*$/)
|
||||||
{
|
{
|
||||||
# sleep between 1 and 5 seconds and try again
|
# sleep between 1 and 5 seconds and try again
|
||||||
|
Loading…
x
Reference in New Issue
Block a user