From 4830444a7c75113f1f503e09aba626cc7b07f03e Mon Sep 17 00:00:00 2001 From: Pau Escrich Date: Tue, 23 Feb 2016 12:58:32 +0100 Subject: [PATCH] [luci-app-bmx6] When drawing the network topology graph, try first wget-ssl Signed-off-by: Pau Escrich --- .../files/usr/lib/lua/luci/model/bmx6json.lua | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/luci-app-bmx6/files/usr/lib/lua/luci/model/bmx6json.lua b/luci-app-bmx6/files/usr/lib/lua/luci/model/bmx6json.lua index dfe9ab1..a4a8e43 100644 --- a/luci-app-bmx6/files/usr/lib/lua/luci/model/bmx6json.lua +++ b/luci-app-bmx6/files/usr/lib/lua/luci/model/bmx6json.lua @@ -112,12 +112,16 @@ function wget(url, timeout) if pid == 0 then rfd:close() nixio.dup(wfd, nixio.stdout) - - local candidates = { "/usr/bin/wget", "/bin/wget" } + -- candidates for wget, try first ones with SSL support + local candidates = {{"/usr/bin/wget-ssl",1},{"/usr/bin/wget",0},{"/bin/wget",0}} local _, bin for _, bin in ipairs(candidates) do - if nixiofs.access(bin, "x") then - nixio.exec(bin, "-q", "-O", "-", url) + if nixiofs.access(bin[1], "x") then + if bin[2] == 0 then + nixio.exec(bin[1], "-q", "-O", "-", url) + else + nixio.exec(bin[1], "--no-check-certificate", "-q", "-O", "-", url) + end end end return -- 2.30.2