From 5a2e504ff7755660a008afc79ddf8d11584b7d11 Mon Sep 17 00:00:00 2001 From: lisaac Date: Sat, 26 Feb 2022 08:38:54 +0800 Subject: [PATCH] fix #144 --- .../luasrc/model/cbi/dockerman/container.lua | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/applications/luci-app-dockerman/luasrc/model/cbi/dockerman/container.lua b/applications/luci-app-dockerman/luasrc/model/cbi/dockerman/container.lua index 12df9e92..20220ad8 100644 --- a/applications/luci-app-dockerman/luasrc/model/cbi/dockerman/container.lua +++ b/applications/luci-app-dockerman/luasrc/model/cbi/dockerman/container.lua @@ -714,13 +714,14 @@ elseif action == "console" then if not cmd_docker or not cmd_ttyd or cmd_docker:match("^%s+$") or cmd_ttyd:match("^%s+$") then return end + local uci = (require "luci.model.uci").cursor() - local ttyd_ssl = uci.get("ttyd", "@ttyd[0]", "ssl") - local ttyd_ssl_key = uci.get("ttyd", "@ttyd[0]", "ssl_key") - local ttyd_ssl_cert = uci.get("ttyd", "@ttyd[0]", "ssl_cert") + local ttyd_ssl = uci:get("ttyd", "@ttyd[0]", "ssl") + local ttyd_ssl_key = uci:get("ttyd", "@ttyd[0]", "ssl_key") + local ttyd_ssl_cert = uci:get("ttyd", "@ttyd[0]", "ssl_cert") - if ttyd_ssl=="1" and ttyd_ssl_cert and ttyd_ssl_key then - cmd_ttyd=string.format('%s -S -C %s -K %s',cmd_ttyd,ttyd_ssl_cert,ttyd_ssl_key) + if ttyd_ssl == "1" and ttyd_ssl_cert and ttyd_ssl_key then + cmd_ttyd = string.format('%s -S -C %s -K %s', cmd_ttyd, ttyd_ssl_cert, ttyd_ssl_key) end local pid = luci.util.trim(luci.util.exec("netstat -lnpt | grep :7682 | grep ttyd | tr -s ' ' | cut -d ' ' -f7 | cut -d'/' -f1")) @@ -729,7 +730,6 @@ elseif action == "console" then end local hosts - local uci = (require "luci.model.uci").cursor() local remote = uci:get_bool("dockerd", "dockerman", "remote_endpoint") or false local host = nil local port = nil