%# 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%>