From 1d2252a990f1be42d87b625c1a6f67b90de0d0f7 Mon Sep 17 00:00:00 2001 From: Ted Trask Date: Tue, 1 Jan 2013 21:10:42 +0000 Subject: Replace io.popen with modelfunctions.run_executable --- opennhrp-model.lua | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'opennhrp-model.lua') diff --git a/opennhrp-model.lua b/opennhrp-model.lua index 6f32ae7..c59e22e 100644 --- a/opennhrp-model.lua +++ b/opennhrp-model.lua @@ -194,10 +194,7 @@ end function getshowreport() local peers_list = cfe({ type="structure", value={}, label="Peers" }) local opennhrpstatus = cfe({ value="Show report not available", label="Status" }) - local cmd = "/usr/sbin/opennhrpctl show 2>/dev/null" - local f = io.popen( cmd ) - local content = f:read("*a") - f:close() + local content = modelfunctions.run_executable({"opennhrpctl", "show"}) local current for line in string.gmatch(content, "([^\n]*)\n?") do if string.find(line, "^Status:") then -- cgit v1.2.3