Better subprocess handling
authorRoman Bazalevskiy <rvb@rvb.name>
Sun, 19 Mar 2017 21:32:53 +0000 (00:32 +0300)
committerRoman Bazalevskiy <rvb@rvb.name>
Sun, 19 Mar 2017 21:32:53 +0000 (00:32 +0300)
mqtt-bt/scan-beacons

index 1709e9323cf436fd8de576e101cdd97518aaf977..34de7dc8f93830f9bafd074226a3c6fb8d2fc1e3 100644 (file)
@@ -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