summaryrefslogtreecommitdiffhomepage
path: root/applications/luci-app-advanced-reboot/luasrc
diff options
context:
space:
mode:
Diffstat (limited to 'applications/luci-app-advanced-reboot/luasrc')
-rw-r--r--applications/luci-app-advanced-reboot/luasrc/advanced-reboot/devices/linksys-e4200v2-ea4500.lua2
-rw-r--r--applications/luci-app-advanced-reboot/luasrc/advanced-reboot/devices/linksys-ea3500.lua2
-rw-r--r--applications/luci-app-advanced-reboot/luasrc/advanced-reboot/devices/linksys-ea6350v3.lua2
-rw-r--r--applications/luci-app-advanced-reboot/luasrc/advanced-reboot/devices/linksys-ea8300.lua2
-rw-r--r--applications/luci-app-advanced-reboot/luasrc/advanced-reboot/devices/linksys-ea8500.lua2
-rw-r--r--applications/luci-app-advanced-reboot/luasrc/advanced-reboot/devices/linksys-wrt1200ac.lua2
-rw-r--r--applications/luci-app-advanced-reboot/luasrc/advanced-reboot/devices/linksys-wrt1900ac.lua4
-rw-r--r--applications/luci-app-advanced-reboot/luasrc/advanced-reboot/devices/linksys-wrt1900acs.lua2
-rw-r--r--applications/luci-app-advanced-reboot/luasrc/advanced-reboot/devices/linksys-wrt1900acv2.lua2
-rw-r--r--applications/luci-app-advanced-reboot/luasrc/advanced-reboot/devices/linksys-wrt3200acm.lua2
-rw-r--r--applications/luci-app-advanced-reboot/luasrc/advanced-reboot/devices/linksys-wrt32x.lua2
-rw-r--r--applications/luci-app-advanced-reboot/luasrc/advanced-reboot/devices/zyxel-nbg6817.lua2
-rw-r--r--applications/luci-app-advanced-reboot/luasrc/controller/advanced_reboot.lua18
13 files changed, 26 insertions, 18 deletions
diff --git a/applications/luci-app-advanced-reboot/luasrc/advanced-reboot/devices/linksys-e4200v2-ea4500.lua b/applications/luci-app-advanced-reboot/luasrc/advanced-reboot/devices/linksys-e4200v2-ea4500.lua
index 710ba3ef3c..6122409dd1 100644
--- a/applications/luci-app-advanced-reboot/luasrc/advanced-reboot/devices/linksys-e4200v2-ea4500.lua
+++ b/applications/luci-app-advanced-reboot/luasrc/advanced-reboot/devices/linksys-e4200v2-ea4500.lua
@@ -1,7 +1,7 @@
return {
vendorName = "Linksys",
deviceName = "E4200v2/EA4500",
- boardName = "linksys-viper",
+ boardNames = { "linksys-viper", "linksys,viper" },
partition1MTD = "mtd3",
partition2MTD = "mtd5",
labelOffset = 32,
diff --git a/applications/luci-app-advanced-reboot/luasrc/advanced-reboot/devices/linksys-ea3500.lua b/applications/luci-app-advanced-reboot/luasrc/advanced-reboot/devices/linksys-ea3500.lua
index f0ac1febc2..553788fd57 100644
--- a/applications/luci-app-advanced-reboot/luasrc/advanced-reboot/devices/linksys-ea3500.lua
+++ b/applications/luci-app-advanced-reboot/luasrc/advanced-reboot/devices/linksys-ea3500.lua
@@ -1,7 +1,7 @@
return {
vendorName = "Linksys",
deviceName = "EA3500",
- boardName = "linksys-audi",
+ boardNames = { "linksys-audi", "linksys,audi" },
partition1MTD = "mtd3",
partition2MTD = "mtd5",
labelOffset = 32,
diff --git a/applications/luci-app-advanced-reboot/luasrc/advanced-reboot/devices/linksys-ea6350v3.lua b/applications/luci-app-advanced-reboot/luasrc/advanced-reboot/devices/linksys-ea6350v3.lua
index 5c7aecd1fb..ccfe55ead1 100644
--- a/applications/luci-app-advanced-reboot/luasrc/advanced-reboot/devices/linksys-ea6350v3.lua
+++ b/applications/luci-app-advanced-reboot/luasrc/advanced-reboot/devices/linksys-ea6350v3.lua
@@ -1,7 +1,7 @@
return {
vendorName = "Linksys",
deviceName = "EA6350v3",
- boardName = "linksys-ea6350v3",
+ boardNames = { "linksys-ea6350v3", "linksys,ea6350v3" },
partition1MTD = "mtd10",
partition2MTD = "mtd12",
labelOffset = 192,
diff --git a/applications/luci-app-advanced-reboot/luasrc/advanced-reboot/devices/linksys-ea8300.lua b/applications/luci-app-advanced-reboot/luasrc/advanced-reboot/devices/linksys-ea8300.lua
index e0cec8549b..e5faf27876 100644
--- a/applications/luci-app-advanced-reboot/luasrc/advanced-reboot/devices/linksys-ea8300.lua
+++ b/applications/luci-app-advanced-reboot/luasrc/advanced-reboot/devices/linksys-ea8300.lua
@@ -1,7 +1,7 @@
return {
vendorName = "Linksys",
deviceName = "EA8300",
- boardName = "linksys-ea8300",
+ boardNames = { "linksys-ea8300", "linksys,ea8300" },
partition1MTD = "mtd10",
partition2MTD = "mtd12",
labelOffset = 192,
diff --git a/applications/luci-app-advanced-reboot/luasrc/advanced-reboot/devices/linksys-ea8500.lua b/applications/luci-app-advanced-reboot/luasrc/advanced-reboot/devices/linksys-ea8500.lua
index d60cf61556..865b726835 100644
--- a/applications/luci-app-advanced-reboot/luasrc/advanced-reboot/devices/linksys-ea8500.lua
+++ b/applications/luci-app-advanced-reboot/luasrc/advanced-reboot/devices/linksys-ea8500.lua
@@ -1,7 +1,7 @@
return {
vendorName = "Linksys",
deviceName = "EA8500",
- boardName = "linksys-ea8500",
+ boardNames = { "linksys-ea8500", "linksys,ea8500" },
partition1MTD = "mtd13",
partition2MTD = "mtd15",
labelOffset = 32,
diff --git a/applications/luci-app-advanced-reboot/luasrc/advanced-reboot/devices/linksys-wrt1200ac.lua b/applications/luci-app-advanced-reboot/luasrc/advanced-reboot/devices/linksys-wrt1200ac.lua
index f14fba2c9b..a3efb69732 100644
--- a/applications/luci-app-advanced-reboot/luasrc/advanced-reboot/devices/linksys-wrt1200ac.lua
+++ b/applications/luci-app-advanced-reboot/luasrc/advanced-reboot/devices/linksys-wrt1200ac.lua
@@ -1,7 +1,7 @@
return {
vendorName = "Linksys",
deviceName = "WRT1200AC",
- boardName = "linksys-caiman",
+ boardNames = { "linksys-caiman", "linksys,caiman", "linksys,wrt1200ac" },
partition1MTD = "mtd4",
partition2MTD = "mtd6",
labelOffset = 32,
diff --git a/applications/luci-app-advanced-reboot/luasrc/advanced-reboot/devices/linksys-wrt1900ac.lua b/applications/luci-app-advanced-reboot/luasrc/advanced-reboot/devices/linksys-wrt1900ac.lua
index 01bec1bdeb..24869bef82 100644
--- a/applications/luci-app-advanced-reboot/luasrc/advanced-reboot/devices/linksys-wrt1900ac.lua
+++ b/applications/luci-app-advanced-reboot/luasrc/advanced-reboot/devices/linksys-wrt1900ac.lua
@@ -1,7 +1,7 @@
return {
vendorName = "Linksys",
- deviceName = "WRT1900AC",
- boardName = "linksys-mamba",
+ deviceName = "WRT1900ACv1",
+ boardNames = { "linksys-mamba", "linksys,mamba", "linksys,wrt1900ac-v1" },
partition1MTD = "mtd4",
partition2MTD = "mtd6",
labelOffset = 32,
diff --git a/applications/luci-app-advanced-reboot/luasrc/advanced-reboot/devices/linksys-wrt1900acs.lua b/applications/luci-app-advanced-reboot/luasrc/advanced-reboot/devices/linksys-wrt1900acs.lua
index f90042338e..6b409a191f 100644
--- a/applications/luci-app-advanced-reboot/luasrc/advanced-reboot/devices/linksys-wrt1900acs.lua
+++ b/applications/luci-app-advanced-reboot/luasrc/advanced-reboot/devices/linksys-wrt1900acs.lua
@@ -1,7 +1,7 @@
return {
vendorName = "Linksys",
deviceName = "WRT1900ACS",
- boardName = "linksys-shelby",
+ boardNames = { "linksys-shelby", "linksys,shelby", "linksys,wrt1900acs" },
partition1MTD = "mtd4",
partition2MTD = "mtd6",
labelOffset = 32,
diff --git a/applications/luci-app-advanced-reboot/luasrc/advanced-reboot/devices/linksys-wrt1900acv2.lua b/applications/luci-app-advanced-reboot/luasrc/advanced-reboot/devices/linksys-wrt1900acv2.lua
index f9b8244382..15062eb547 100644
--- a/applications/luci-app-advanced-reboot/luasrc/advanced-reboot/devices/linksys-wrt1900acv2.lua
+++ b/applications/luci-app-advanced-reboot/luasrc/advanced-reboot/devices/linksys-wrt1900acv2.lua
@@ -1,7 +1,7 @@
return {
vendorName = "Linksys",
deviceName = "WRT1900ACv2",
- boardName = "linksys-cobra",
+ boardNames = { "linksys-cobra", "linksys,cobra", "linksys,wrt1900ac-v2" },
partition1MTD = "mtd4",
partition2MTD = "mtd6",
labelOffset = 32,
diff --git a/applications/luci-app-advanced-reboot/luasrc/advanced-reboot/devices/linksys-wrt3200acm.lua b/applications/luci-app-advanced-reboot/luasrc/advanced-reboot/devices/linksys-wrt3200acm.lua
index 3efd1a612a..2e4cbec1a4 100644
--- a/applications/luci-app-advanced-reboot/luasrc/advanced-reboot/devices/linksys-wrt3200acm.lua
+++ b/applications/luci-app-advanced-reboot/luasrc/advanced-reboot/devices/linksys-wrt3200acm.lua
@@ -1,7 +1,7 @@
return {
vendorName = "Linksys",
deviceName = "WRT3200ACM",
- boardName = "linksys-rango",
+ boardNames = { "linksys-rango", "linksys,rango", "linksys,wrt3200acm" },
partition1MTD = "mtd5",
partition2MTD = "mtd7",
labelOffset = 32,
diff --git a/applications/luci-app-advanced-reboot/luasrc/advanced-reboot/devices/linksys-wrt32x.lua b/applications/luci-app-advanced-reboot/luasrc/advanced-reboot/devices/linksys-wrt32x.lua
index 740426362f..dd9baf5511 100644
--- a/applications/luci-app-advanced-reboot/luasrc/advanced-reboot/devices/linksys-wrt32x.lua
+++ b/applications/luci-app-advanced-reboot/luasrc/advanced-reboot/devices/linksys-wrt32x.lua
@@ -1,7 +1,7 @@
return {
vendorName = "Linksys",
deviceName = "WRT32X",
- boardName = "linksys-venom",
+ boardNames = { "linksys-venom", "linksys,venom", "linksys,wrt32x" },
partition1MTD = "mtd5",
partition2MTD = "mtd7",
labelOffset = nil,
diff --git a/applications/luci-app-advanced-reboot/luasrc/advanced-reboot/devices/zyxel-nbg6817.lua b/applications/luci-app-advanced-reboot/luasrc/advanced-reboot/devices/zyxel-nbg6817.lua
index 4b696227b6..0e91124725 100644
--- a/applications/luci-app-advanced-reboot/luasrc/advanced-reboot/devices/zyxel-nbg6817.lua
+++ b/applications/luci-app-advanced-reboot/luasrc/advanced-reboot/devices/zyxel-nbg6817.lua
@@ -1,7 +1,7 @@
return {
vendorName = "ZyXEL",
deviceName = "NBG6817",
- boardName = "nbg6817",
+ boardNames = { "nbg6817" },
partition1MTD = "mmcblk0p4",
partition2MTD = "mmcblk0p7",
labelOffset = 32,
diff --git a/applications/luci-app-advanced-reboot/luasrc/controller/advanced_reboot.lua b/applications/luci-app-advanced-reboot/luasrc/controller/advanced_reboot.lua
index a8297d7c79..1fb4d461b6 100644
--- a/applications/luci-app-advanced-reboot/luasrc/controller/advanced_reboot.lua
+++ b/applications/luci-app-advanced-reboot/luasrc/controller/advanced_reboot.lua
@@ -1,4 +1,4 @@
--- Copyright 2017-2018 Stan Grishin <stangri@melmac.net>
+-- Copyright 2017-2020 Stan Grishin <stangri@melmac.net>
-- Licensed to the public under the Apache License 2.0.
module("luci.controller.advanced_reboot", package.seeall)
@@ -98,15 +98,23 @@ function obtain_device_info()
local p_func = loadfile(devices_dir .. filename)
setfenv(p_func, { _ = i18n.translate })
p = p_func()
- boardName = p.boardName:gsub('%p','')
+ if p.boardName then
+ boardName = p.boardName:gsub('%p','')
+ end
+ if p.boardNames then
+ for i, v in pairs(p.boardNames) do
+ boardName = v:gsub('%p','')
+ if romBoardName and romBoardName:gsub('%p',''):match(boardName) then break end
+ end
+ end
if romBoardName and romBoardName:gsub('%p',''):match(boardName) then
if p.labelOffset then
if p.partition1MTD then
- p1_label = util.trim(util.exec("dd if=/dev/" .. p.partition1MTD .. " bs=1 skip=" .. p.labelOffset .. " count=128" .. " 2>/dev/null"))
+ p1_label = util.trim(util.exec("dd if=/dev/" .. p.partition1MTD .. " bs=1 skip=" .. p.labelOffset .. " count=128" .. " 2>/dev/null"))
n, p1_version = p1_label:match('(Linux)-([%d|.]+)')
end
if p.partition2MTD then
- p2_label = util.trim(util.exec("dd if=/dev/" .. p.partition2MTD .. " bs=1 skip=" .. p.labelOffset .. " count=128" .. " 2>/dev/null"))
+ p2_label = util.trim(util.exec("dd if=/dev/" .. p.partition2MTD .. " bs=1 skip=" .. p.labelOffset .. " count=128" .. " 2>/dev/null"))
n, p2_version = p2_label:match('(Linux)-([%d|.]+)')
end
if p1_label and p1_label:find("LEDE") then p1_os = "LEDE" end
@@ -160,7 +168,7 @@ function obtain_device_info()
end
function index()
- entry({"admin", "system", "advanced_reboot"}, call("action_template"), _("Advanced Reboot"), 90)
+ entry({"admin", "system", "advanced_reboot"}, call("action_template"), _("Advanced Reboot"), 90).acl_depends = { "luci-app-advanced-reboot" }
entry({"admin", "system", "advanced_reboot", "reboot"}, post("action_reboot"))
entry({"admin", "system", "advanced_reboot", "alternative_reboot"}, post("action_altreboot"))
entry({"admin", "system", "advanced_reboot", "power_off"}, post("action_poweroff"))