<%- require "luci.sys" require "nixio.fs" local cel_module = luci.sys.exec("uci -q get network.cellular.module | xargs echo -n") or "" local url = luci.sys.exec("uci -q get radioupdate.general.url | xargs echo -n") or "" local filename = luci.sys.exec("uci -q get radioupdate.general.filename | xargs echo -n") or "" local carrier = "" local function safe_name(name) if not name or name == "" or #name > 200 then return "" end if name:find("%.%.", 1, true) or not name:match("^[%w%._%-]+$") then return "" end local ext = name:match("%.([%w]+)$") if not ext then return "" end ext = ext:lower() if ext ~= "spk" and ext ~= "nvu" and ext ~= "cwe" and ext ~= "zip" and ext ~= "bin" then return "" end return name end filename = safe_name(filename) if cel_module:match("EM74%d+") then carrier = safe_name(luci.sys.exec("uci -q get radioupdate.general.carrier | xargs echo -n") or "") end -%>