luci-app-dockerman: cbi/container fix indent

Signed-off-by: Florian Eckert <fe@dev.tdt.de>
This commit is contained in:
Florian Eckert 2020-07-28 16:05:02 +02:00
parent dff11ad240
commit c19a7d18e5

View file

@ -700,28 +700,31 @@ elseif action == "console" then
local cmd_docker = luci.util.exec("which docker"):match("^.+docker") or nil local cmd_docker = luci.util.exec("which docker"):match("^.+docker") or nil
local cmd_ttyd = luci.util.exec("which ttyd"):match("^.+ttyd") or nil local cmd_ttyd = luci.util.exec("which ttyd"):match("^.+ttyd") or nil
if not cmd_docker or not cmd_ttyd or cmd_docker:match("^%s+$") or cmd_ttyd:match("^%s+$") then return end if not cmd_docker or not cmd_ttyd or cmd_docker:match("^%s+$") or cmd_ttyd:match("^%s+$")then
local kill_ttyd = 'netstat -lnpt | grep ":7682[ \t].*ttyd$" | awk \'{print $NF}\' | awk -F\'/\' \'{print "kill -9 " $1}\' | sh > /dev/null' return
luci.util.exec(kill_ttyd) end
local hosts
local uci = (require "luci.model.uci").cursor()
local remote = uci:get_bool("dockerd", "globals", "remote_endpoint")
local host = nil
local port = nil
local socket = nil
if remote then local kill_ttyd = 'netstat -lnpt | grep ":7682[ \t].*ttyd$" | awk \'{print $NF}\' | awk -F\'/\' \'{print "kill -9 " $1}\' | sh > /dev/null'
host = uci:get("dockerd", "globals", "remote_host") or nil luci.util.exec(kill_ttyd)
port = uci:get("dockerd", "globals", "remote_port") or nil local hosts
else local uci = (require "luci.model.uci").cursor()
socket = uci:get("dockerd", "globals", "socket_path") or nil local remote = uci:get_bool("dockerd", "globals", "remote_endpoint")
end local host = nil
local port = nil
local socket = nil
if remote and host and port then if remote then
hosts = host .. ':'.. port host = uci:get("dockerd", "globals", "remote_host") or nil
elseif socket_path then port = uci:get("dockerd", "globals", "remote_port") or nil
hosts = "unix://" .. socket_path else
else socket = uci:get("dockerd", "globals", "socket_path") or nil
end
if remote and host and port then
hosts = host .. ':'.. port
elseif socket_path then
hosts = "unix://" .. socket_path
else
return return
end end