summaryrefslogtreecommitdiffstats
path: root/zebra-model.lua
diff options
context:
space:
mode:
Diffstat (limited to 'zebra-model.lua')
-rw-r--r--zebra-model.lua5
1 files changed, 2 insertions, 3 deletions
diff --git a/zebra-model.lua b/zebra-model.lua
index 2581d59..fc5b559 100644
--- a/zebra-model.lua
+++ b/zebra-model.lua
@@ -36,9 +36,8 @@ end
local function telnetshowip()
local output = {}
local configfile = parseconfigfile() or {}
- local cmd = path .. "echo -e '" .. format.escapespecialcharacters(configfile.password) .. "\nshow ip route\nquit\n' | nc localhost zebra 2>/dev/null"
- local f = io.popen( cmd )
- local result = f:read("*a") or ""
+ local cmd = (configfile.password or "") .. "\nshow ip route\nquit\n"
+ local result, errtxt = modelfunctions.run_executable({"nc", "localhost", "zebra"}, false, cmd)
local validoutput
if result == "" then
result = "Failed to find routes"