summaryrefslogtreecommitdiffstats
path: root/ospf-model.lua
diff options
context:
space:
mode:
authorTed Trask <ttrask01@yahoo.com>2013-01-02 00:01:48 +0000
committerTed Trask <ttrask01@yahoo.com>2013-01-02 00:01:48 +0000
commitd95073f61f98ccd2273043f3c8e7d571584bdac1 (patch)
tree3cd8c1b09e13388b96d556dadcaff5a181478617 /ospf-model.lua
parent2e4c8861822d69a6a25cb88b52c9c179179c4e84 (diff)
downloadacf-quagga-d95073f61f98ccd2273043f3c8e7d571584bdac1.tar.bz2
acf-quagga-d95073f61f98ccd2273043f3c8e7d571584bdac1.tar.xz
Replace io.popen with modelfunctions.run_executable
Diffstat (limited to 'ospf-model.lua')
-rw-r--r--ospf-model.lua6
1 files changed, 2 insertions, 4 deletions
diff --git a/ospf-model.lua b/ospf-model.lua
index ca390ce..ae1c74d 100644
--- a/ospf-model.lua
+++ b/ospf-model.lua
@@ -36,10 +36,8 @@ end
local function telnetshowip()
local output = {}
local configfile = parseconfigfile() or {}
- local cmd = path .. "echo -e '" .. format.escapespecialcharacters(configfile.password) .. "\nshow ip ospf route\nquit\n' | nc localhost ospfd 2>/dev/null"
- local f = io.popen( cmd )
- local result = f:read("*a") or ""
- f:close()
+ local cmd = (configfile.password or "") .. "\nshow ip ospf route\nquit\n"
+ local result, errtxt = modelfunctions.run_executable({"nc", "localhost", "ospfd"}, false, cmd)
if result == "" then
result = "Failed to find routes"
end