gluon-core: allow setting PoE passthrough default setting from site.conf
This commit is contained in:
parent
f2feea2d3a
commit
b1a753e1c5
@ -229,6 +229,9 @@ mesh_on_wan \: optional
|
||||
mesh_on_lan \: optional
|
||||
Enables the mesh on the LAN port (``true`` or ``false``).
|
||||
|
||||
poe_passthrough \: optional
|
||||
Enable PoE passthrough by default on hardware with such a feature.
|
||||
|
||||
autoupdater \: package
|
||||
Configuration for the autoupdater feature of Gluon.
|
||||
|
||||
|
@ -30,3 +30,5 @@ for _, config in ipairs({'wifi24', 'wifi5'}) do
|
||||
need_number(config .. '.channel')
|
||||
end
|
||||
end
|
||||
|
||||
need_boolean('poe_passthrough', false)
|
||||
|
13
package/gluon-core/luasrc/lib/gluon/upgrade/150-poe-passthrough
Executable file
13
package/gluon-core/luasrc/lib/gluon/upgrade/150-poe-passthrough
Executable file
@ -0,0 +1,13 @@
|
||||
#!/usr/bin/lua
|
||||
|
||||
local sysconfig = require 'gluon.sysconfig'
|
||||
local site = require 'gluon.site_config'
|
||||
|
||||
if (not sysconfig.gluon_version) and (site.poe_passthrough == true) then
|
||||
local uci = require('luci.model.uci').cursor()
|
||||
|
||||
if uci:get('system', 'gpio_switch_poe_passthrough') then
|
||||
uci:set('system', 'gpio_switch_poe_passthrough', 'value', 1)
|
||||
uci:save('system')
|
||||
end
|
||||
end
|
Loading…
Reference in New Issue
Block a user