gluon-setup-mode: allow skipping on first boot
By setting setup_mode.skip to true in site.conf the device will skip setup mode on first boot.
This commit is contained in:
parent
8e33dd5075
commit
629409364b
@ -35,4 +35,9 @@ define Package/gluon-setup-mode/install
|
|||||||
$(CP) ./files/* $(1)/
|
$(CP) ./files/* $(1)/
|
||||||
endef
|
endef
|
||||||
|
|
||||||
|
define Package/gluon-setup-mode/postinst
|
||||||
|
#!/bin/sh
|
||||||
|
$(call GluonCheckSite,check_site.lua)
|
||||||
|
endef
|
||||||
|
|
||||||
$(eval $(call BuildPackage,gluon-setup-mode))
|
$(eval $(call BuildPackage,gluon-setup-mode))
|
||||||
|
2
package/gluon-setup-mode/check_site.lua
Normal file
2
package/gluon-setup-mode/check_site.lua
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
need_boolean('setup_mode.skip', false)
|
||||||
|
|
@ -0,0 +1,16 @@
|
|||||||
|
#!/usr/bin/lua
|
||||||
|
|
||||||
|
local site = require 'gluon.site_config'
|
||||||
|
local uci = require 'luci.model.uci'
|
||||||
|
|
||||||
|
local c = uci.cursor()
|
||||||
|
|
||||||
|
if site.setup_mode
|
||||||
|
and site.setup_mode.skip
|
||||||
|
and not c:get_first('gluon-setup-mode', 'setup_mode', 'configured', false) then
|
||||||
|
local name = c:get_first("gluon-setup-mode", "setup_mode")
|
||||||
|
c:set("gluon-setup-mode", name, "configured", 1)
|
||||||
|
c:save('gluon-setup-mode')
|
||||||
|
c:commit('gluon-setup-mode')
|
||||||
|
end
|
||||||
|
|
Loading…
Reference in New Issue
Block a user