From bb5d24ae6623bf629268bccea47ab9a2cac1aeef Mon Sep 17 00:00:00 2001 From: Roman Bazalevskiy Date: Mon, 20 Mar 2017 00:32:53 +0300 Subject: [PATCH] Better subprocess handling --- mqtt-bt/scan-beacons | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/mqtt-bt/scan-beacons b/mqtt-bt/scan-beacons index 1709e93..34de7dc 100644 --- a/mqtt-bt/scan-beacons +++ b/mqtt-bt/scan-beacons @@ -72,11 +72,12 @@ end function open_dump() - f = assert(io.popen ("hcidump --raw")) - run_command("kill `pgrep hcitool`") - run_command("hciconfig hci0 down") - run_command("hciconfig hci0 up") - f_null = assert(io.popen ("hcitool lescan --duplicates")) + run_command("/bin/kill `/usr/bin/pgrep hcidump`") + run_command("/bin/kill `/usr/bin/pgrep hcitool`") + f = assert(io.popen ("/usr/bin/hcidump --raw")) + run_command("/usr/bin/hciconfig hci0 down") + run_command("/usr/bin/hciconfig hci0 up") + f_null = assert(io.popen ("/usr/bin/hcitool lescan --duplicates")) return f -- 2.34.1