<%# updateFW.htm -%> <% local fs = require "nixio.fs" local has_ping6 = fs.access("/bin/ping6") or fs.access("/usr/bin/ping6") local has_traceroute6 = fs.access("/usr/bin/traceroute6") local dns_host = "www.ingeteam.com" local ping_host = "www.ingeteam.com" local route_host = "www.ingeteam.com" local chp = require "luci.model.charging_points" local path = luci.dispatcher.context.requestpath local user, serialnumber, hw_model = chp.whoami(path) local cl = path[1] local utl = require "luci.util" local mUtl = require "luci.moreUtils" local sn = mUtl.get_serialnumber() local model = mUtl.model(path[4] or sn) local mod = require "luci.model.global_variables" local url local master = mUtl.identify_pseudo_maestre(path[4] or sn ) if mod.url then local servers = mod.url url = servers[model] or "http://ingerev.com/feeds/abw0001/xenial//Packages" end if master == true then method = path[4] or sn else method = path[4] end local swupdate = utl.ubus(method,"get_configuration") local checked_d, checked_c, checked = false , show if swupdate and swupdate.swupdate then swupdate = swupdate.swupdate end if swupdate and swupdate.url then if url == swupdate.url then checked = true checked_d = "checked" checked_c = "" show = "none" else checked_c = "checked" checked_d = "" show = "flex" end end --If lince versión dont let enter any url local lince = false local ver = utl.ubus("uci", "get", {config = "ingeteam"}) if ver and ver.values then for k , v in pairs (ver.values) do if v and v.release and string.find(v.release, "Lince") then lince = true end end end -%> <%+header%>

<%:Update Firmware%><%: - %><%=path[4]%>

<% if lince == false then %>
/>
/>
" />
" id="save_value" onclick="saveUrl()"/>
<%end%> <%if master == true then %>
<%=translate("Upload a compatible file here")%>


<% if install then %>
<% if #stdout > 0 then %>
<%=pcdata(stdout)%>
<% end %> <% if #stderr > 0 then %>
<%=pcdata(stderr)%>
<% end %>
<% end %> <% if update == "none" then %>
<%=translate("Error, file not supported!")%>
<% else %> <% if upload then %>
<%=translate("File successfully uploaded")%>
<% if update == "opk" then %>
<%=translate("Update the operating system of your device")%>
<%:Force update%>
<% end %>
<% elseif not overview then %>
<%=translate("Unknown Error, file not uploaded!")%>
<% end %> <% end %>
<%end%>
<%:Check internet connection%>
<%=translate("Here you can check internet connection to make sure you can reach the server, a common test is to check google dns server (8.8.8.8) connection")%>

<% if has_ping6 then %> <% else %> <% end %>


<%+footer%>